I’m using C# in .Net 2.0, and I want to read in a PNG image file and check for the first row and first column that has non-transparent pixels.
What assembly and/or class should I use?
Programmer, engineer, scientist, critic, gamer, dreamer, and kid-at-heart.
I’m using C# in .Net 2.0, and I want to read in a PNG image file and check for the first row and first column that has non-transparent pixels.
What assembly and/or class should I use?
Of course I googled already and found the PngBitmapDecoder class, but it doesn’t seem to be available in .Net 2.0?
http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.pngbitmapdecoder.aspx
The above link mentions it’s in the PresentationCore assembly which I don’t seem to have included with .Net 2.0
Bitmap class from System.Drawing.dll assembly:
Well, Bitmap class can read a PNG file and access pixels. Can it see transparent pixels? PNG supports transparency while BMP does not. But still, it works.
Code above read my little picture and then read a transparent pixel. Color class has RGBA values, and the pixel I read was in recognized as transparent.