C# Класс Accord.Imaging.Filters.Shrink

Shrink an image by removing specified color from its boundaries.

Removes pixels with specified color from image boundaries making the image smaller in size.

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

Sample usage:

// create filter Shrink filter = new Shrink( Color.Black ); // apply the filter Bitmap newImage = filter.Apply( image );

Initial image:

Result image:

Наследование: BaseTransformationFilter
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Shrink ( ) : System

Initializes a new instance of the Shrink class.

Shrink ( Color colorToRemove ) : System

Initializes a new instance of the Shrink class.

Защищенные методы

Метод Описание
CalculateNewImageSize ( UnmanagedImage sourceData ) : Size

Calculates new image size.

ProcessFilter ( UnmanagedImage sourceData, UnmanagedImage destinationData ) : void

Process the filter on the specified image.

Описание методов

CalculateNewImageSize() защищенный Метод

Calculates new image size.
protected CalculateNewImageSize ( UnmanagedImage sourceData ) : Size
sourceData UnmanagedImage Source image data.
Результат System.Drawing.Size

ProcessFilter() защищенный Метод

Process the filter on the specified image.
protected ProcessFilter ( UnmanagedImage sourceData, UnmanagedImage destinationData ) : void
sourceData UnmanagedImage Source image data.
destinationData UnmanagedImage Destination image data.
Результат void

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

Initializes a new instance of the Shrink class.
public Shrink ( ) : System
Результат System

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

Initializes a new instance of the Shrink class.
public Shrink ( Color colorToRemove ) : System
colorToRemove Color Color to remove from boundaries.
Результат System