Picturebox with transparent image?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi, I have got two pictureboxes. the second one has got a transparent image,
but the transparent area is not transparent and I can not see this area from
picturebox1. How can set the background to transparent? thanks.....juvi
 
The code to draw a "transparent" bitmap in C# is something like:

Color c = ... // your "transparent" color
ImageAttributes a = new ImageAttributes();
ia.SetColorKey(c, c);
Graphics g = ... // e.g. the PaintEvent's Graphics
g.Clear(Parent.BackColor); // assuming this code is part of a control's

OnPaint method
g.DrawImage(..., a);
 
Back
Top