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

ImageStatisticsHSL() public method

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

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

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

Same methods

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