AnnSetTransparentColor method (Main Control)

Visual Basic example
Visual C++ 4.0 example

Syntax short AnnSetTransparentColor(OLE_HANDLE hObject, OLE_COLOR crTransparent, BOOL bSelected);

Overview:  Refer to Implementing Annotations.

Remarks

(Document/Medical only) Sets the transparent color.

The standard Windows values for COLORREF represent either red, green, and blue color values, or an index into the bitmap's palette. A COLORREF value with the format 0x00BBGGRR represents the blue, green, and red color values for the specified pixel, where 0xBB is the blue value, 0xGG is the green value and 0xRR is the red value. If 0x01000000 is set in the COLORREF value (0x010000ZZ), the lower 8 bits (0xZZ) represent an index into the bitmap's palette which holds the color value. These COLORREF values can be used with any Windows function and macro that takes a COLORREF parameter.

In the Document/Medical Imaging editions, the COLORREF value may represent a 16 bit grayscale value if pBitmap is a 12 or 16-bit grayscale bitmap. So that the value is not confused with an RGB value, the COLORREF_GRAY16 mask (0x04000000) is set. In this case (0x0400YYYY), the lower 16 bits (0xYYYY) of the COLORREF value represent the 16-bit grayscale value. (0x0400FFFF is 16-bit white and 0x04000000is 16-bit black.) This is not a standard Windows value. Therefore, LEADTOOLS functionality will recognize a COLORREF having this format, but Windows functions will not. For information on how to use a 16-bit grayscale COLORREF in a non-LEADTOOLS functionality, refer to Converting 16-bit Grayscale Values.

Only stamp objects and point objects that have a bitmap will use the transparent color.

This transparent color is used only if the object is set to transparent using AnnSetTransparent method.

By default, the transparent color is white (0x00FFFFFF).

If hObject is a container object, then bSelected indicates which objects to process. If hObject is an automation object, all objects created by this automation object will have this transparent color.

In design mode, the transparent color can be picked by selecting the Transparent color from the properties menu. If the object’s bitmap has a palette, a dialog box will come up allowing you to select a color from the palette colors. If the object’s bitmap does not have a palette, the standard Windows color pick dialog box is used to select a transparent color.

See Also

Elements:  AnnGetTransparentColor method, AnnSetTransparent method

Topics:  Annotations (Document/Medical only): Object Bitmap