L_AnnSetTransparent

#include "l_bitmap.h"

L_LTANN_API L_INT L_AnnSetTransparent(hObject, bTransparent, uFlags)

Sets one or more bitmap objects to use a transparent color. A transparent color is not painted when the image is painted.

Parameters

HANNOBJECT hObject

Handle to the annotation object.

L_BOOL 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.

L_UINT 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

Value Meaning
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:

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 LTEFXu.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

Platforms

Win32, x64.

See Also

Functions

Topics

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; 
} 
Help Version 20.0.2020.4.3
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help