Click or drag to resize

ReduceColorsCommandSelectPreferredPixelFormat Method

Chooses a pixel format that is preferred for this command.

Namespace:  Atalasoft.Imaging.ImageProcessing.Effects
Assembly:  Atalasoft.dotImage (in Atalasoft.dotImage.dll) Version: (.NET 4.5.2, x86)
protected override PixelFormat SelectPreferredPixelFormat(
	AtalaImage sourceImage,
	PixelFormat sourceFormat,
	PixelFormat[] formats


Type: Atalasoft.ImagingAtalaImage
The original source image.
Type: Atalasoft.ImagingPixelFormat
The original image's pixel format.
Type: Atalasoft.ImagingPixelFormat
An array of pixel formats supported by this command.

Return Value

Type: PixelFormat
A new pixel format to use for this command.

The default implementation returns the sourceFormat value.

In theory, a command should only ever return pixel format that it has direct support for. Unfortunately, many older commands advertised that they supported pixel formats that were not native to the command. To maintain compatibility with older versions of dotImage, this method allows a command to select a new pixel format for itself, without being bound to the ApplyToAnyPixelFormat property.

See Also