AForge.Imaging.UnmanagedImage.GetPixel C# (CSharp) Method

GetPixel() public method

Get color of the pixel with the specified coordinates.

See GetPixel(int, int) for more information.

public GetPixel ( IntPoint point ) : Color
point IntPoint Point's coordiates to get color of.
return Color
        public Color GetPixel( IntPoint point )
        {
            return GetPixel( point.X, point.Y );
        }

Same methods

UnmanagedImage::GetPixel ( int x, int y ) : Color

Usage Example

Beispiel #1
0
        public static int AvgColor(System.Drawing.Image img, int forceZeroBelow)
        {
            long total = 0;

            AForge.Imaging.UnmanagedImage umimg = AForge.Imaging.UnmanagedImage.FromManagedImage(new Bitmap(img));
            for (int y = 0; y < umimg.Height; y++)
            {
                for (int x = 0; x < umimg.Width; x++)
                {
                    Color c = umimg.GetPixel(x, y);
                    total += forceZeroBelow > ((c.R + c.G + c.B) / 3) ? 0 : 255;
                }
            }
            return((int)((long)total / ((long)umimg.Width * (long)umimg.Height)));
        }
All Usage Examples Of AForge.Imaging.UnmanagedImage::GetPixel