I am trying to save a wmf from the clipboard to a gif file, using Paul's wrapper
I use
SavePicture data.GetData(metaFile), wmfFilepath
Set imgBmp = New cBitmap
imgBmp.LoadFromFile wmfFilepath
codecIndex = imgBmp.ExtensionExists("*.gif")
imgBmp.SaveToFile gifFilepath, imgBmp.EncoderGuid(codecIndex), 0
Kill wmfFilepath

I have two problems

- The wmf file correctly shows a transparent background, but the GIF file has a black background. I have tried
imgBmp.SetTransColor 0 and also 255
but without success

- the Kill wmfFilePath returns Permission Demied

Ideas please!

OnErr0r

01-04-2005, 02:28 PM

I have an example of saving the transparent color of a GIF in the Code Library.

GregDuncan

01-04-2005, 03:10 PM

imgBmp still has a lock on the file. That is why you cant delete it.
Do a set imgBmp = nothing before the kill statement.

phil2005

01-05-2005, 04:26 AM

I have an example of saving the transparent color of a GIF in the Code Library.

I've looked in the Code library at your GDI+ page and done a search on "transparent" but I can't find the sample you are referencing ("GIF" is too short a word for the search engine!)

Sorry, but please can you tell me where to look.

OnErr0r

01-05-2005, 10:47 AM

http://www.visualbasicforum.com/showthread.php?t=92821

Notice that you can bring up the entire GIF palette, once the image has been quantized. The palette entry selected becomes the transparent item when saved. The save code will be most informative.

phil2005

01-06-2005, 09:04 AM

http://www.xtremevbtalk.com/showthread.php?t=92821

Notice that you can bring up the entire GIF palette, once the image has been quantized. The palette entry selected becomes the transparent item when saved. The save code will be most informative.

I have tried this but all the transparent areas of all my gif images show black and the palette entries are all black also.

When I run the Quantise function on any gif I can find, it gives "Error, not 24 bit image".

I am using your tlb dated 24/5/04 and I had to edit the source of the sample to get it to run. I had to change
Private tGuids() As GDIPlus.Guid to Private tGuids() As GDIPlus.clsid (any any .GUID references to CLSID as well) and had to remove the withEvents from Private WithEvents gdip As cBitmap and Public WithEvents gdipGif As cBitmap
.

I then tried a mini-project containing this....
Dim gdipWrapper As cGDIP