Click or drag to resize

DynamicThresholdCommandConstructChangedSourceImage Method

The method is called by the default implementation of Apply. It determines if it is necessary to create a copy of the source image in a different pixel format and if so, determines the best new pixel format and allocates that image.

Namespace:  Atalasoft.Imaging.ImageProcessing.Document
Assembly:  Atalasoft.dotImage (in Atalasoft.dotImage.dll) Version: 11.4.0.9.0.377 (.NET 4.5.2, x86)
Syntax
protected override AtalaImage ConstructChangedSourceImage(
	AtalaImage image
)

Parameters

image
Type: Atalasoft.ImagingAtalaImage
The original source image passed to Apply.

Return Value

Type: AtalaImage
A new image in a pixel format supported by the command or null to indicate that the original image is acceptable.
Remarks

The default implementation of ConstructChangedSourceImage requests that the command report its preferred pixel format (typically, this is the source image's pixel format, but some commands support many pixel formats, but work best in gray, for example), and if that is supported, returns a new image in the preferred format if it is different from the source image.

If the pixel format is not supported and ApplyToAnyPixelFormat is set to true, the command is queried for its best alternate pixel format and a new image is returned in that pixel format. If ApplyToAnyPixelFormat is set to false, ConstructChangedSourceImage will throw an IncompatiblePixelFormatException.

If an error occurs, ConstructChangedImage should throw an exception. Any new image constructed by ConstructChangedImage must be a pixel format supported by this command.

See Also