Saving a transparent GIF

Blake81

Well-known member
Joined
Feb 23, 2006
Messages
304
Location
Georgia, USA
Programming Experience
1-3
I have code that will make the right parts of a picturebox image transparent when I right click it, but how can I get it to save the image as a transparent GIF? I tried to find code to do this, but it doesn't work. This is the part I have for saving the file (which doesn't keep the transparency.)

VB.NET:
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        Dim mytrancolor As Color = Color.FromArgb(255, 255, 255, 255)
        Dim savebmp As New Bitmap(q)
        Dim gg As Graphics = Graphics.FromImage(savebmp)
        savebmp.MakeTransparent(Label1.BackColor)
'gg.Clear(mytrancolor)
        'savebmp.SetResolution(500, 500)
        savebmp.Save("C:\Documents and Settings\Owner\Desktop\shape2.gif", System.Drawing.Imaging.ImageFormat.Gif)
    End Sub
 
Back
Top