Gif image transparent

G

Guest

hi,All

I have a gif image(done by photoshop, and the background is transparent)
I want to draw it on my forms.
But the background is not transparent.

How to do it?

I try source below:but it does not work?

ImageAttributes imageAttr = new ImageAttributes();
imageAttr.SetColorKey(Color.FromArgb(0,255,0),Color.FromArgb(0,255,0));
//imageAttr.SetColorKey(Color.Blue,Color.Blue);
// Draw the image with the color key set.
System.Drawing.Rectangle rect;
try
{
rect = new Rectangle(0, 0, this.m_bmp.Width, this.m_bmp.Height);
e.Graphics.DrawImage(m_bmp, // Image
rect, // Dest. rect.
0, // srcX
0, // srcY
this.m_bmp.Width, // srcWidth
this.m_bmp.Height, // srcHeight
GraphicsUnit.Pixel, // srcUnit
imageAttr); // ImageAttributes
}
catch(Exception ex){}

thanks in advance
 
G

Guest

Windows CE doesn't support transparent images, so usually the transparent
color becomes white or black. You can try identify it by getting a pixel from
the top left corner.

Color transpColor = m_bmp.GetPixel(0, 0);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top