C# Class SoundInTheory.DynamicImage.Filters.ResizeFilter

Changes the size of a Layer. This filter can be used in several ways depending on the effect you wish to achieve.

There are five modes available for the ResizeFilter filter.

By default, images will not be enlarged if they are smaller than the target size. However, you can set the ResizeFilter.EnlargeImage property to true to allow enlargement.
Inheritance: ImageReplacementFilter
显示文件 Open project: sitdap/dynamic-image Class Usage Examples

Protected Methods

Method Description
ApplyFilter ( FastBitmap source, System.Windows.Media.DrawingContext dc, int destinationWidth, int destinationHeight ) : void

Applies the ResizeFilter to the specified source.

GetDestinationDimensions ( FastBitmap source, int &width, int &height ) : bool

Returns the dimensions of the output image.

Private Methods

Method Description
CalculateOutputDimensions ( int nInputWidth, int nInputHeight, int nRequestedWidth, int nRequestedHeight, int &nOutputWidth, int &nOutputHeight ) : void

Method Details

ApplyFilter() protected method

Applies the ResizeFilter to the specified source.
protected ApplyFilter ( FastBitmap source, System.Windows.Media.DrawingContext dc, int destinationWidth, int destinationHeight ) : void
source FastBitmap The source image.
dc System.Windows.Media.DrawingContext
destinationWidth int
destinationHeight int
return void

GetDestinationDimensions() protected method

Returns the dimensions of the output image.
protected GetDestinationDimensions ( FastBitmap source, int &width, int &height ) : bool
source FastBitmap The source image.
width int The desired width of the output image.
height int The desired height of the output image.
return bool