Fill areas outiside of specified region.

The filter fills areas outside of specified region using the specified color.

The filter accepts 8bpp grayscale and 24/32 bpp color images for processing.

Sample usage:

// create filter CanvasCrop filter = new CanvasCrop( new Rectangle( 5, 5, image.Width - 10, image.Height - 10 ), Color.Red ); // apply the filter filter.ApplyInPlace( image );

Initial image:

Result image:

Inheritance: BaseInPlaceFilter
Example #1
0
        private void SetFilter()
        {
            ImageType = ImageTypes.ARgb32bpp;

            if (originalSize)
            {
                Af.CanvasCrop newFilter = new Af.CanvasCrop(region);
                newFilter.FillColorRGB = color;

                imageFilter = newFilter;
            }
            else
            {
                Af.Crop newFilter = new Af.Crop(region);
                imageFilter = newFilter;
            }
        }