Parameters
Name | Explanation |
---|---|
PixelType | The number of bits per pixel (1, 4, 8, 16, 24, 32, 40, 80) after the conversion. * 4 represents 4 bit color, 40 is for 4 bit grayscale, 8 is for 8 bit color, and 80 is for 8 bit grayscale. |
FixedPal | Fixed palette settings (Use when decreasing or increasing to 1, 4, or 8 bit color) False (0): Uses a created palette most suitable for the image True (nonzero): Uses a fixed palette |
Dither | Sets the dither (error diffusion) (Use when decreasing to 1, 4, or 8 bit color or 4 bit grayscale) False(0): Does not dither True(nonzero): Dithers |
Level | Threshold value settings (Use when decreasing to 1 bit images) 0 to 255 |
Return Value
Returns True (nonzero) if successful, otherwise returns False (0).
Explanation
The ConvertColor method changes the number of colors
(also known as the bit count) of a raster image.
To execute the ConvertColor method, set the image handle of
the image in the ImageHandle property or the
Layer(LayerNo).ImageHandle
property. When decreasing the number of colors of an image to 1 bit
color, if the RGB value (an average of the red, green, and blue
values) is less than the threshold value, the palette is set to 0,
otherwise it is set to 1. If the specified RGB values can not be
selected, a black image is created. If successful the resulting
raster image data is set in the ImageHandle property or the
Layer(LayerNo).ImageHandle
property depending on the value of the LayerNo property. If unsuccessful, 0
is returned.
When the Caption, Message, and ButtonName properties are blank, the
progress dialog box will not be displayed. When the progress dialog
box is displayed, the percentage that the processing has completed
will be shown in the dialog box.