piscis Posted October 9, 2003 Posted October 9, 2003 How to make a GIF inside a picturebox transparent Does anyone knows how to make an animated GIF inside a picturebox transparent, so the background of the form can be seen? Thanks Andy Quote
*Experts* mutant Posted October 9, 2003 *Experts* Posted October 9, 2003 Dim b As Bitmap = PictureBox1.Image 'create a bitmap object b.MakeTransparent(color you want transparent) 'set a color transparent PictureBox1.Image = b 'reassign modified picture to the pixbox The key in this code is the MakeTransparent method of the bitmap object. Which will make any color you specify transparent on the bitmap. :) Quote
piscis Posted October 9, 2003 Author Posted October 9, 2003 mutant: Thanks for your reply I tried this code and all I got was a statict image showing only the first frame of the Gif Animation. It has the transparent background I wanted but unfortunately no animation or movement at all. Do you know by any change how to modify this code so the GIF animation animates? Thanks Private WaterDrops As Bitmap WaterDrops = PictureBox1.Image WaterDrops.MakeTransparent(WaterDrops.GetPixel(0, 0)) PictureBox1.Image = WaterDrops Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.