C# Class AForge.Imaging.Filters.ResizeNearestNeighbor

Resize image using nearest neighbor algorithm.

The class implements image resizing filter using nearest neighbor algorithm, which does not assume any interpolation.

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

Sample usage:

// create filter ResizeNearestNeighbor filter = new ResizeNearestNeighbor( 400, 300 ); // apply the filter Bitmap newImage = filter.Apply( image );

Initial image:

Result image:

Inheritance: AForge.Imaging.Filters.BaseResizeFilter
Afficher le fichier Open project: holisticware-admin/MonoVersal.AForgeNET Class Usage Examples

Méthodes publiques

Méthode Description
ResizeNearestNeighbor ( int newWidth, int newHeight ) : System

Initializes a new instance of the ResizeNearestNeighbor class.

Méthodes protégées

Méthode Description
ProcessFilter ( UnmanagedImage sourceData, UnmanagedImage destinationData ) : void

Process the filter on the specified image.

Method Details

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

ResizeNearestNeighbor() public méthode

Initializes a new instance of the ResizeNearestNeighbor class.
public ResizeNearestNeighbor ( int newWidth, int newHeight ) : System
newWidth int Width of the new image.
newHeight int Height of the new image.
Résultat System