AForge.Imaging.Image.FormatImage C# (CSharp) Method

FormatImage() private method

private FormatImage ( Bitmap &image ) : void
image System.Drawing.Bitmap
return void
        public static void FormatImage( ref Bitmap image )
        {
            if (
                ( image.PixelFormat != PixelFormat.Format24bppRgb ) &&
                ( image.PixelFormat != PixelFormat.Format32bppRgb ) &&
                ( image.PixelFormat != PixelFormat.Format32bppArgb ) &&
                ( image.PixelFormat != PixelFormat.Format48bppRgb ) &&
                ( image.PixelFormat != PixelFormat.Format64bppArgb ) &&
                ( image.PixelFormat != PixelFormat.Format16bppGrayScale ) &&
                ( IsGrayscale( image ) == false )
                )
            {
                Bitmap tmp = image;
                // convert to 24 bits per pixel
                image = Clone( tmp, PixelFormat.Format24bppRgb );
                // delete old image
                tmp.Dispose( );
            }
        }