Search code examples
.netvb.netgdi+metafileimage-conversion

GDI+ Image Conversion From Metafile to JPEG/GIF Results in Black Background


So i am converting a metafile (EMF to be exact) to a jpeg or gif (doesn't matter as long as it's compatible with browsers) and when I do the conversion, all of the transparent pixels turn black. I have no idea how to do this in GDI+ but here is the method I am using to save the file:

Dim Img As System.Drawing.Imaging.Metafile = New System.Drawing.Imaging.Metafile(stream)
Img.Save(Server.MapPath("/FileName.gif"), System.Drawing.Imaging.ImageFormat.Gif)

Solution

  • Check out Bob Powell's web site. He has a metric-crap-ton of GDI+ stuff. this one is specifically for trans GIF's