C# Class Accord.Imaging.Filters.Crop

Crop an image.

The filter crops an image providing a new image, which contains only the specified rectangle of the original image.

The filter accepts 8 and 16 bpp grayscale images and 24, 32, 48 and 64 bpp color images for processing.

Sample usage:

// create filter Crop filter = new Crop( new Rectangle( 75, 75, 320, 240 ) ); // apply the filter Bitmap newImage = filter.Apply( image );

Initial image:

Result image:

Inheritance: BaseTransformationFilter
Afficher le fichier Open project: accord-net/framework Class Usage Examples

Méthodes publiques

Méthode Description
Crop ( Rectangle rect ) : System

Initializes a new instance of the Crop class.

Méthodes protégées

Méthode Description
CalculateNewImageSize ( UnmanagedImage sourceData ) : Size

Calculates new image size.

ProcessFilter ( UnmanagedImage sourceData, UnmanagedImage destinationData ) : void

Process the filter on the specified image.

Method Details

CalculateNewImageSize() protected méthode

Calculates new image size.
protected CalculateNewImageSize ( UnmanagedImage sourceData ) : Size
sourceData UnmanagedImage Source image data.
Résultat System.Drawing.Size

Crop() public méthode

Initializes a new instance of the Crop class.
public Crop ( Rectangle rect ) : System
rect System.Drawing.Rectangle Rectangle to crop.
Résultat System

ProcessFilter() protected méthode

Process the filter on the specified image.
protected ProcessFilter ( UnmanagedImage sourceData, UnmanagedImage destinationData ) : void
sourceData UnmanagedImage Source image data.
destinationData UnmanagedImage Destination image data.
Résultat void