C# Class AForge.Imaging.Filters.CanvasCrop

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
Mostra file Open project: holisticware-admin/MonoVersal.AForgeNET

Public Methods

Method Description
CanvasCrop ( Rectangle region ) : System.Drawing

Initializes a new instance of the CanvasCrop class.

CanvasCrop ( Rectangle region, Color fillColorRGB ) : System.Drawing

Initializes a new instance of the CanvasCrop class.

CanvasCrop ( Rectangle region, Color fillColorRGB, byte fillColorGray ) : System.Drawing

Initializes a new instance of the CanvasCrop class.

CanvasCrop ( Rectangle region, byte fillColorGray ) : System.Drawing

Initializes a new instance of the CanvasCrop class.

Protected Methods

Method Description
ProcessFilter ( UnmanagedImage image ) : void

Process the filter on the specified image.

Private Methods

Method Description
CanvasCrop ( ) : System.Drawing

Method Details

CanvasCrop() public method

Initializes a new instance of the CanvasCrop class.
public CanvasCrop ( Rectangle region ) : System.Drawing
region System.Drawing.Rectangle Region to keep.
return System.Drawing

CanvasCrop() public method

Initializes a new instance of the CanvasCrop class.
public CanvasCrop ( Rectangle region, Color fillColorRGB ) : System.Drawing
region System.Drawing.Rectangle Region to keep.
fillColorRGB System.Drawing.Color RGB color to use for filling areas outside of specified region in color images.
return System.Drawing

CanvasCrop() public method

Initializes a new instance of the CanvasCrop class.
public CanvasCrop ( Rectangle region, Color fillColorRGB, byte fillColorGray ) : System.Drawing
region System.Drawing.Rectangle Region to keep.
fillColorRGB System.Drawing.Color RGB color to use for filling areas outside of specified region in color images.
fillColorGray byte Gray color to use for filling areas outside of specified region in grayscale images.
return System.Drawing

CanvasCrop() public method

Initializes a new instance of the CanvasCrop class.
public CanvasCrop ( Rectangle region, byte fillColorGray ) : System.Drawing
region System.Drawing.Rectangle Region to keep.
fillColorGray byte Gray color to use for filling areas outside of specified region in grayscale images.
return System.Drawing

ProcessFilter() protected method

Process the filter on the specified image.
protected ProcessFilter ( UnmanagedImage image ) : void
image UnmanagedImage Source image data.
return void