I need to create an image with a transparent background in .NETCF, I use a magenta background as the background that I want to make transparent. The way I tried to do this is to override onPaint (). But I canβt get the background transparent? Here is what I have:
protected override void OnPaint(PaintEventArgs e) { Graphics g = e.Graphics; ImageAttributes imageAttributs = new ImageAttributes(); imageAttributs.SetColorKey(Color.FromArgb(255, 0, 255), Color.FromArgb(255, 0, 255)); g.DrawImage(cross, crossRect, 200, 10, cross.Width, cross.Height, GraphicsUnit.Pixel, imageAttributs); base.OnPaint(e); }
But when I try to enable ImageAttributes, is my image not drawn at all?
DNRN
source share