I'm displaying a PNG with a transparent background that looks good in Windows 7, but then I run my app in XP Mode or remote desktop to a Windows XP machine and the PNG looks incorrect. I noticed that if I disable "Integration Mode" or run the app on XP without remote desktop, the image looks fine.
How do I get DrawImage to render the PNG correctly in XP Mode or remote desktop?
Image inside Windows 7
Image inside XP Mode or remote desktop
Here's my code:
protected override void OnPaint(PaintEventArgs e)
{
Image image = Image.FromFile("hello.png", false);
Bitmap bmp = new Bitmap(image);
Rectangle destRect = new Rectangle(0, 0, image.Width, image.Height);
e.Graphics.DrawImage(image, destRect, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel);
base.OnPaint(e);
}