Better quality with GIF export method, are there any switches ?

  • Thread starter Gunnar Johansson
  • Start date
G

Gunnar Johansson

Hi,

I export chartobjects (embedded charts in a worksheet) temporary to be able
to load them into a userform. I find the quality of the loaded picture to be
to poor. Are there any switches or something I can use with the export
filter to specify the size etc?

The loaded picture should become larger than the chartobject. I have tried
to boost the size of the chartobject to get a larger gif, but with no
success.

....
Sub ExpChartLoadImg()
Set CurrentChart = Sheet1.ChartObjects(ChartNum).Chart

' Save chart as GIF
Fname = ThisWorkbook.Path & Application.PathSeparator & "temp.GIF"
CurrentChart.Export Filename:=Fname, FilterName:="GIF"

' Show the chart
Image1.Picture = LoadPicture(Fname)
End Sub

/Regards
 
G

Guest

hi
the immage control has setting in it's property sheet.
if property PicturesizeMode is set to stretch, the gif
will fill the immage control regardless of how big the
immage is.
is that what you are trying to do/want?
 
S

Stephen Bullen

Hi Gunnar,
I export chartobjects (embedded charts in a worksheet) temporary to be able
to load them into a userform. I find the quality of the loaded picture to be
to poor. Are there any switches or something I can use with the export
filter to specify the size etc?

No, but you could use the PastePicture.zip example from my web site instead.

Regards

Stephen Bullen
Microsoft MVP - Excel
www.oaltd.co.uk
 
K

keepITcool

First:

you;ll need a wrapper DLL for VB's clipboard functions..
download it HERE..

http://www.aboutvb.de/dow/dowfile.htm?vba&clpboard.zip

Register the DLL with REGSVR
Reference the avbClipboard class in your project..


THEN you could use..


Private Sub UserForm_Click()
Dim cho As ChartObject

Set cho = Worksheets(1).Shapes(1).DrawingObject
Call cho.CopyPicture(xlPrinter, xlPicture)
Image1.PictureSizeMode = fmPictureSizeModeStretch
Image1.Picture = avbClipboard.GetData(avbCFMetafile)

End Sub


WOW... fast and sharp!
(it remains a metafile so no distortion on the GIF save/load


keepITcool

< email : keepitcool chello nl (with @ and .) >
< homepage: http://members.chello.nl/keepitcool >


Gunnar Johansson wrote in message
 
G

Gunnar Johansson

Thank you all.
The picturemode was set to strech....
I'll look into the other suggestions as well.

/regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top