I’ve got a PNG image that I’m operating on via the System.Drawing API in .NET. It has large transparent regions, and I would like to replace the transparent regions with white fill–so that there are no transparent regions in the image. Easy enough in an image editing program… but so far I’ve had no success doing this in C#.
Can someone give me some pointers?
I’m not sure how to detect transparent pixel. I know if the Alpha is 0 it’s completly transparent and if it’s 255 it’s opaque. I’m not sure if you should check for Alpha == 0 or Alpha != 255 ; if you can try it and give me a feedback that would be helpful.
From MSDN