L_BM_COLORRES

Send this message to change the color resolution of an L_BITMAPCLASS window's bitmap. This message provides flexibility in specifying the output destination and in specifying the palette to use.

Parameter

Meaning

wParam

Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.

lParam

Points to a LEADBITMAPCOLORRES structure. For a description, refer to the LEADBITMAPCOLORRES Structure described below.

Returns

SUCCESS

Function was successful.

< 0

An error occurred. Refer to Return Codes.

 

LEADBITMAPCOLORRES Structure

The L_BM_COLORRES message lets you change the bits per pixel of an image in the L_BITMAPCLASS registered class. Before sending the message, your program must declare a LEADBITMAPCOLORRES structure.

The following table describes the fields in the structure, using ColRes as the name of the LEADBITMAPCOLORRES structure.

Sample Field Name

Data Type

Description

ColRes.uStructSize

L_UINT

Size of the LEADBITMAPCOLORRES structure. This field allows for compatibility with future enhancements. It can be specified as follows:

ColRes.uStructSize = sizeof(ColRes);

ColRes.BitsPerPixel

L_INT

The number of bits per pixel to increase or decrease the bitmap to. Valid values are 1, 4, 8, 16, 24, and 32.

ColRes.Flags

L_UINT32

Indicator of the color order or palette usage. Refer to Possible Flag Values.

ColRes.pPalette

LPRGBQUAD

The palette to use if the CRF_USERPALETTE is specified in the Flags field.

This is an array of RGBQUAD values. For each item in the array do one of the following:

image\sqrblit.gif Enter the actual RGBQUAD value to specify a fixed color.

image\sqrblit.gif Enter RGB_RESERVED to Leave the item blank, for possible later use.

image\sqrblit.gif Enter RGB_EMPTY to let LEADTOOLS fill in the color. LEADTOOLS supplies optimized colors to fill the RGB_EMPTY items.

If CRF_USERPALETTE is not specified in the Flags field, this field should be NULL.

ColRes.Colors

L_UINT

The number of colors in the palette specified by the pPalette field.

If CRF_USERPALETTE is not specified in the Flags field, this field should be NULL