Products | Support | Send comments on this topic. | Email a link to this topic. | Back to Getting Started | Help Version 18.0.11.1
LEADTOOLS Raster Imaging C DLL Help

L_AnnSetTransparent

Show in webframe

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

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

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

Win32, x64.

See Also

Functions:

L_AnnGetTransparent, L_AnnGetSelected, L_AnnSetSelected, L_AnnGetROP2, L_AnnSetROP2, L_AnnGetFillMode, L_AnnSetFillMode, L_AnnGetOptions, L_AnnSetOptions

Topics

Annotation Functions (Document/Medical only) Displaying Annotations

 

Annotation Objects - Default Values

 

Annotation Objects - Automated Features

 

Implementing an Automated Annotation Program

 

Implementing a Non-automated Annotation Program

 

Altering Annotation Object Settings

 

Annotation Functions (Document/Medical only): Getting and Setting the Transparency Property

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;
}
Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.