Changes the bits per pixel of the current image.
Visual Basic |
---|
Public Sub ColorDepth( _ ByVal IPBitsPixel As Integer, _ ByVal IPPalette As enumPalette, _ ByVal IPDither As enumDithered _ ) |
- IPBitsPixel
The new number of bits per pixel to change the image.
Valid range is 1, 4, 8, and 24.
- IPPalette
The enumPalette enumeration specifies which color palette to apply to the image, if the bit depth is reduced to 8-bits or less.Value Description IPAL_Fixed Fixed - The image will be displayed using an internal fixed palette. IPAL_Gray Gray Scale - The image will be displayed using a gray scale palette. IPAL_Optimized Optimized - The image will be displayed using the best possible palette for each image. IPAL_PalFile Palette File - The image will be displayed using a palette file. IPAL_UserDefined User defined - The image will be displayed using a palette defined by the user using the PRGBSetColors method. - IPDither
The enumDithered enumeration specifies the dither type to utilize, if the bit depth is reduced to 8-bits or less.Value Description DI_BinarizePhotoHalftone Binarize photo halftone. DI_BinarizeQuickText Binarize quick text. DI_Floyd Floyd-Steinberg. DI_None None. DI_Ordered Ordered. DI_Pegasus Pegasus.
When the IPPalette parameter is set to IPAL_PalFile, the palette file is specified in the PFileName property.
When the IPPalette parameter is set to IPAL_UserDefined, the palette is defined by the PRGBSetColors method.
Note: enumDithered.DI_BinarizeQuickText and enumDithered.DI_BinarizePhotoHalftone can only be used if IPBitsPixel is 1, otherwise an error is returned because the image isn't being binarized.