AForge.Imaging.Filters.BaseInPlaceFilter.ApplyInPlace C# (CSharp) Method

ApplyInPlace() public method

Apply filter to an image.
The method applies the filter directly to the provided source image.
Unsupported pixel format of the source image.
public ApplyInPlace ( Bitmap image ) : void
image System.Drawing.Bitmap Image to apply filter to.
return void
        public void ApplyInPlace( Bitmap image )
        {
            // check pixel format of the source image
            CheckSourceFormat( image.PixelFormat );

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

            try
            {
                // process the filter
                ProcessFilter( new UnmanagedImage( data ) );
            }
            finally
            {
                // unlock image
                image.UnlockBits( data );
            }
        }

Same methods

BaseInPlaceFilter::ApplyInPlace ( BitmapData imageData ) : void
BaseInPlaceFilter::ApplyInPlace ( UnmanagedImage image ) : void