L_AnnSetTransparent
#include "l_bitmap.h"
L_LTANN_API L_INT L_AnnSetTransparent(hObject, bTransparent, uFlags)
HANNOBJECT hObject; |
/* handle to the annotation object */ |
L_BOOL bTransparent; |
/* flag that indicates whether to make the bitmap transparent */ |
L_UINT uFlags; |
/* flags to determine which objects to process */ |
Sets one or more bitmap objects to use a transparent color. A transparent color is not painted when the image is painted.
This function is available in the Document and Medical Imaging toolkits.
Parameter |
Description |
|
hObject |
Handle to the annotation object. |
|
bTransparent |
Flag that indicates whether to make the bitmap transparent. Possible values are: |
|
|
Value |
Meaning |
|
TRUE |
Make the bitmap transparent |
|
FALSE |
Do not make the bitmap transparent. This is the default. |
uFlags |
Flags that determine which objects to process. Most of the flags apply only to container objects. You can combine values when appropriate by using a bitwise OR ( | ). The following are valid values: |
|
|
Value |
Meaning |
|
0 |
Process only the specified object. |
|
ANNFLAG_SELECTED |
[0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions. |
|
ANNFLAG_NOTTHIS |
[0x0004] Process only one level of objects within the specified container, not the container itself. If there are containers within the container, they are modified, but the objects within them are not. |
|
ANNFLAG_RECURSE |
[0x0008] Process objects within a container, and within any subcontainers, down to any level. |
|
ANNFLAG_NOTCONTAINER |
[0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves. |
|
ANNFLAG_NOINVALIDATE |
[0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages. |
|
ANNFLAG_CHECKMENU |
[0x0020] Process objects only if the ANNAUTOTEXT_MENU_TRANSPARENT menu item has been selected. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
Sets one or more bitmap objects to use a transparent color. A transparent color is not painted when the image is painted. The L_AnnSetTransparent function is valid only for the following object types when they are using a bitmap:
ANNOBJECT_POINT
ANNOBJECT_STAMP
In addition, the Automation object stores transparency settings along with the other object default settings.
Call the L_AnnSetTransparent function to set such objects to use a transparent color. By default the transparent color is white (0x00FFFFFF). In order for the transparent bitmaps to be painted properly the LTEFX15u.dll needs to be present for WIN32. If the appropriate DLL is not present, the transparent bitmap stamps will be painted as non-transparent bitmap stamps.
When this function is applied to an automation object, it indicates whether the next stamp created will be transparent.
When an object has a bitmap with a region and the object is transparent, the inside of the region is considered non-transparent. If the bitmap has no region, and the object is transparent, a region is created from all the pixels that are not the transparent color.
Call the L_AnnSetTransparentColor function to set the color to be used as the transparent color. Call the L_AnnGetTransparent function to get a value that indicates whether the bitmap being used by the annotation object is using a transparent color. Call the L_AnnGetTransparentColor function to get a value that indicates which color is being used as the transparent color.
Required DLLs and Libraries
LTANN For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
Platforms
Windows 2000 / XP/Vista.
See Also
Example
L_INT AnnSetTransparentExample(HANNOBJECT hAnnObject) { L_INT nRet; L_BOOL bTransparent; nRet = L_AnnGetTransparent(hAnnObject, &bTransparent); if(nRet != SUCCESS) return nRet; /* toggle the transparency setting for STAMP objects */ if(bTransparent) { /* no transparency */ nRet = L_AnnSetTransparent(hAnnObject, FALSE, ANNFLAG_RECURSE); if(nRet != SUCCESS) return nRet; } else { /* white will be transparent */ nRet = L_AnnSetTransparent(hAnnObject, TRUE, ANNFLAG_RECURSE); if(nRet != SUCCESS) return nRet; } return SUCCESS; }