AForge.Imaging.Filters.BaseUsingCopyPartialFilter.Apply C# (CSharp) Метод

Apply() публичный Метод

Apply filter to an image.
The method keeps the source image unchanged and returns the result of image processing filter as new image.
Unsupported pixel format of the source image.
public Apply ( Bitmap image ) : Bitmap
image System.Drawing.Bitmap Source image to apply filter to.
Результат System.Drawing.Bitmap
        public Bitmap Apply( Bitmap image )
        {
            // lock source bitmap data
            BitmapData srcData = image.LockBits(
                new Rectangle( 0, 0, image.Width, image.Height ),
                ImageLockMode.ReadOnly, image.PixelFormat );

            Bitmap dstImage = null;

            try
            {
                // apply the filter
                dstImage = Apply( srcData );
                if ( ( image.HorizontalResolution > 0 ) && ( image.VerticalResolution > 0 ) )
                {
                    dstImage.SetResolution( image.HorizontalResolution, image.VerticalResolution );
                }
            }
            finally
            {
                // unlock source image
                image.UnlockBits( srcData );
            }

            return dstImage;
        }

Same methods

BaseUsingCopyPartialFilter::Apply ( BitmapData imageData ) : Bitmap
BaseUsingCopyPartialFilter::Apply ( UnmanagedImage image ) : UnmanagedImage
BaseUsingCopyPartialFilter::Apply ( UnmanagedImage sourceImage, UnmanagedImage destinationImage ) : void