AForge.Imaging.ImageStatistics.ImageStatistics C# (CSharp) Method

ImageStatistics() public method

Initializes a new instance of the ImageStatistics class.
Source pixel format is not supported.
public ImageStatistics ( Bitmap image ) : System
image System.Drawing.Bitmap Image to gather statistics about.
return System
        public ImageStatistics( Bitmap image )
        {
            CheckSourceFormat( image.PixelFormat );

            // lock bitmap data
            BitmapData imageData = image.LockBits(
                new Rectangle( 0, 0, image.Width, image.Height ),
                ImageLockMode.ReadOnly, image.PixelFormat );

            try
            {
                // gather statistics
                unsafe
                {

                    ProcessImage( new UnmanagedImage( imageData ), null, 0 );
                }
            }
            finally
            {
                // unlock image
                image.UnlockBits( imageData );
            }
        }

Same methods

ImageStatistics::ImageStatistics ( Bitmap image, Bitmap mask ) : System
ImageStatistics::ImageStatistics ( Bitmap image, byte mask ) : System
ImageStatistics::ImageStatistics ( UnmanagedImage image ) : System
ImageStatistics::ImageStatistics ( UnmanagedImage image, UnmanagedImage mask ) : System
ImageStatistics::ImageStatistics ( UnmanagedImage image, byte mask ) : System