Image.promoteColor(Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Increases the color depth of the image.
public:
virtual int promoteColor(int _noOfColorBits);
public virtual int promoteColor (int _noOfColorBits);
abstract member promoteColor : int -> int
override this.promoteColor : int -> int
Public Overridable Function promoteColor (_noOfColorBits As Integer) As Integer
Parameters
- _noOfColorBits
- Int32
The number of bits that you want to promote the image to.
Returns
0 indicates success; otherwise, failure.
Remarks
The method promotes:
- 8-bit images to 24 or 32 bits.
- 4-bit images to 8, 24, or 32 bits.
- 1-bit images to 4, 8, 24, or 32 bits.
The following example increases the color depth of an image to 8 bits per pixel, unless it is already 8 or more.
Image img = new Image();
img.loadFile(@'C:\test.bmp');
if (conpeek(img.imageInfo(),3) <8)
{
img.promoteColor(8);
}