This function returns a new image with the specified number of colors.
|
Parameter |
Type |
Description |
|
hImage |
HANDLE |
Identifies the image to be reduced. |
|
nColors |
INT |
Specifies the number of colors in the new image (currently limited to 256, 16, or 2). |
|
nFlags |
INT |
Specifies options to be used when reducing the colors. |
Return Value
The return value indicates whether the image was processed successfully. A return value of NULL indicates the color reduction failed, while a nonzero value is the ImageMan handle to the new image.
Comments
Allowable values for the nColors parameter are 2, 16, and 256.
Option Flags include:
|
Flag |
Description |
|
IMG_BURKES |
Specifies the Burkes Dithering algorithm. |
|
IMG_BAYER |
Specifies the Bayer Dither be used. |
|
IMG_FLOYD |
Specifies the Floyd Steinberg dither. |
|
IMG_GRAYSCALE |
Specifies the image should be converted to grayscale. |
|
IMG_FIXEDPALETTE |
Reduces the image to a predefined fixed palette. By using this option, an application can easily display multiple color images simultaneously simply by dithering them to the fixed palette. |
|
IMG_OCTREEPALETTE |
Reduces the image to an octree optimized palette. This option produces the best quality palette. |
|
IMG_MEDIANCUT |
|
|
IMG_16BIT_444_4 |
|
|
IMG_16BIT_555_1 |
|
|
IMG_16BIT_565 |
Note
This function does not alter the original image; rather, it returns a new image based on the passed parameters.
© 1995-2004 Data Techniques, Inc. All rights reserved.