Download PNG file to. Bit Bitmap is very simple:
Bitmap bmp = (Bitmap)Bitmap.FromFile("c:\wherever\whatever.png");
After downloading Bitmap, you can access all your information (including information about alpha channels) most effectively using the Bitmap LockBits method (there are many LockBits code samples in StackOverflow).
Update : here is a sample code that shows how to use LockBits to access pixel pixels of Bitmap data:
System.Drawing.Imaging.BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), System.Drawing.Imaging.ImageLockMode.ReadOnly, bmp.PixelFormat); unsafe {
You need to set the "Allow unsafe code" compiler option for your project to use this code. You can also use the GetPixel (x, y) Bitmap method, but it is surprisingly slow.
Musigenesis
source share