I'm working on a program that creates images from AutoCAD drawings. I can create bmp images with a white background. However, I need to convert the images to gif, with a transparent background. I tried to use maketransparent from the bitmap class, but that does not work. I get a gif image with a black background. Any help would be greatly appreciated.
The bitmaps are 8 bit, 930 x 515 pixels. I have posted my code below:
Thanks
btm
The bitmaps are 8 bit, 930 x 515 pixels. I have posted my code below:
Code:
Private Sub BmpToGif(ByVal fileName As String)
Dim newFile As String
'bitmap class in system.drawing.imaging
Dim objBmp As New Bitmap(fileName & ".bmp")
objBmp.MakeTransparent(Color.White)
newFile = fileName
newFile &= "." & ImageFormat.Gif.ToString
objBmp.Save(newFile, ImageFormat.Gif)
End Sub
Thanks
btm