Changes image pixel format using a combination of palette colors and dithering algorithm when necessary.

Namespace: HiComponents.IEvolution
Assembly: IEvolution2 (in IEvolution2.dll) Version: 10.1.0.0

Syntax

         
 C#  Visual Basic  Visual C++ 
public bool ConvertTo(
	IEImage..::..PixelFormat pixelFormat,
	IERGB[] palette,
	IEImage..::..DitherAlgorithm ditherType,
	bool checkParametersOnly
)
Public Function ConvertTo ( _
	pixelFormat As IEImage..::..PixelFormat, _
	palette As IERGB(), _
	ditherType As IEImage..::..DitherAlgorithm, _
	checkParametersOnly As Boolean _
) As Boolean
public:
bool ConvertTo(
	IEImage..::..PixelFormat pixelFormat, 
	array<IERGB>^ palette, 
	IEImage..::..DitherAlgorithm ditherType, 
	bool checkParametersOnly
)

Parameters

pixelFormat
IEImage..::..PixelFormat
Required pixel format. Can be: ie1g, ie8p, ie8g, ie16g, ie24RGB, ieCMYK, ie48RGB.
palette
array<IERGB>[]()[][]
Specify a custom palette.
ditherType
IEImage..::..DitherAlgorithm
Dither type to use when reducing colors.
checkParametersOnly
Boolean
If True, does not actually convert the image, just checks parameters validity.

Return Value

Not all combinations of parameters are possible, check the return value. Returns True on success.

Examples

CopyC#
ieViewer1.Image.LoadImage(@"input.jpg");
IERGB[] palette = new IERGB[] { new IERGB(0, 0, 0), new IERGB(51, 0, 0), new IERGB(102, 0, 0), new IERGB(153, 0, 0), new IERGB(204, 0, 0), new IERGB(255, 0, 0), new IERGB(0, 51, 0), new IERGB(51, 51, 0) };
ieViewer1.Image.ConvertTo(IEImage.PixelFormat.ie8p, palette, IEImage.DitherAlgorithm.ErrorDiffusion);

See Also