.net - C# Graphics Newbie Question -


I have some small transparent GIF images (less than 100x100) and I have given the code below through all the pixels Written Rgb value to iterate:

  Private zero IteratePixels (string file path) {string dataFormat = String.Empty; Bitmap ozbitmap = new bitmap (file path); Int counter = 0; For (int y = 0; y & lt; objbitmap.Height; y ++) {for (int x = 0; x & lt; objbitmap.Width; x ++) {color col = objbitmap.GetPixel (x , Y); DataFormat = String.Format ("{0} => red: {1: x} green: {2: x} blue: {3: x}", counter ++, colonel, colonel, colonel b); System.Diagnostics.Debug.WriteLine (dataFormat); // Here is an operation on the color value here // objbitmap.SetPixel (x, y, col); Code} works (although the speed of the pixel and string is slow due to formatting) but what was the biggest surprise to me that the output is reporting that the transparent pixels are black! I wonder why? 

0 => red: 0 green: 0 blue: 0
1 => red: 0 green: 0 blue: 0 ...

Now if I have the image 25% of the area covered is a transparent GIF image with a black background, so how do I know if the pixel is tranparent or black?

The images actually have 4 features: red, green, blue and alpha.

How transparent alpha is an area. GIF images are not only transparent / transparent, as opposed to other formats, such as PNG has full alpha support, so that you can work as 40% transparent pixels.

You can call it in your code.

For reference, the MSDN color structure is


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -