Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reading a PNG image file in .Net 2.0

Tags:

c#

.net

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?

like image 584
Roy Tang Avatar asked Sep 19 '08 07:09

Roy Tang


People also ask

How do I read a PNG file?

That means if you want to view a PNG file, you simply need to double-click it and it should open in the default viewer on your computer. You can also view a PNG file by dragging it into any web browser (or use CTRL + O to browse for the file and then open it in a browser).

Does Microsoft support PNG?

It is compatible with all types of cameras and devices. Moreover, it supports all common image formats, including PNG, GIF, JPG, JPEG, TIFF, BMP, PCX, GIFF, MPEG, MPG, etc. It can rebuild advanced image files from equipment.. Also, it repairs all the common Windows image formats.

Why PNG is not showing in HTML?

Right click on the image and select properties. Then if you find an option "unblock" then click on it (sometimes computer blocks some images, hence on the google chrome or internet explorer it won't display) Check the following details are correct a)syntax of html b)path name c)file name d)extension of image.

Does Windows 10 support PNG files?

There are a lot of apps out there that can be used for the PNG file opening. Some of the commonly used apps on windows 10 for PNG file opening are; Microsoft Office, Paint, Picasa Photo Viewer, Windows Photo Viewer, and Photos. All applications are capable of opening PNG files and have different capabilities.


1 Answers

Bitmap class from System.Drawing.dll assembly:

Bitmap bitmap = new Bitmap(@"C:\image.png");
Color clr = bitmap.GetPixel(0, 0);
like image 63
Pavel Chuchuva Avatar answered Sep 22 '22 13:09

Pavel Chuchuva