在.Net 2.0中读取PNG图像文件

我在.Net 2.0中使用C#,我想读取PNG图像文件并检查第一行和第一列是否具有非透明像素。

我应该使用什么assembly和/或类?

System.Drawing.dll程序集中的位图类:

Bitmap bitmap = new Bitmap(@"C:\image.png"); Color clr = bitmap.GetPixel(0, 0); 

好吧,Bitmap类可以读取PNG文件并访问像素。 可以看到透明像素吗? PNG支持透明度,而BMP则不支持透明度。 但它仍然有效。

 Bitmap bitmap = new Bitmap("icn_loading_animated3a.png"); pictureBox1.Image = bitmap; Color pixel5by10 = bitmap.GetPixel(5, 10); 

上面的代码读取我的小图片,然后读取透明像素。 颜色类具有RGBA值,并且我读取的像素被识别为透明。

当然我已经googled并找到了PngBitmapDecoder类,但它似乎在.Net 2.0中不可用?

http://sofzh.miximages.com/c%23/system.windows.media.imaging.pngbitmapdecoder.aspx

上面的链接提到它在PresentationCore程序集中,我似乎没有包含在.Net 2.0中