L_AnnRealize

#include "l_bitmap.h"

L_LTANN_API L_INT L_AnnRealize(pBitmap, prcBounds, hObject, fRedactOnly)

pBITMAPHANDLE pBitmap;

pointer to the bitmap handle

LPRECT prcBounds;

pointer to the bounding rectangle for drawing

HANNOBJECT hObject;

handle to the annotation object

L_BOOL fRedactOnly;

flag that indicates which objects to realize

Applies the specified annotation objects to a bitmap, altering the bitmap, itself.

Parameter Description
pBitmap Pointer to the bitmap handle referencing the bitmap to update.
prcBounds Pointer to the Windows RECT structure that specifies the bounding rectangle where the annotations will be drawn.
  You can pass NULL for the default, which matches the bitmap by specifying left = 0, top = 0, right = bitmap width, and bottom = bitmap height.
hObject Handle to the annotation object.
fRedactOnly Flag that indicates which objects to realize. Possible values are:
  Value Meaning
  TRUE Realize only redaction objects
  FALSE Realize any visible object.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

If you specify a container object, all annotations in the container are realized. You can specify redaction only if you only want to realize redaction objects, which are used for hiding information.

If you realize a redact object, moving the redact object will leave the original location of the redact object hidden. To restore the image under the redact object (so that when you move the redact object, the underlying image is not hidden), you must unrealize the redact object by calling L_AnnUnrealize.

This function is implemented by treating the bitmap as a device context and drawing the annotations in the device context.

When you call L_AnnRealize with fRedactOnly set to TRUE, the background behind the redact object is saved into the redact object. That background info is saved together with the object and can be restored later with L_AnnUnrealize. If a REDACT object has a bitmap already, then the background is not saved. The background is saved inside locked objects, too. This way, complete security can be implemented. If it is desired for some portion of the image to be hidden, a REDACT object can be placed on top and L_AnnRealize with fRedactOnly set to true can be called. The bitmap under the object is changed and that portion is saved inside the Redact object. Next, the object is locked and saved together with the bitmap. To restore the original image, the redact objects have to be unlocked with the correct key and then L_AnnUnrealize must be called each time a Redact object is unlocked.

Encryptor objects cannot be realized. The encryptor is the only annotation object that cannot be realized.

This function works only for 1, 4, 8, 16, and 24-bit images. When using an image that has some other number of bits per pixel, call L_ColorResBitmap to change the image to a supported bits per pixel before calling L_AnnRealize.

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_AnnPrint, L_AnnUnrealize, L_AnnGetLocked, L_AnnLock, L_AnnUnlock, L_AnnShowLockedIcon

Topics:

Annotation Functions: Input and Output

 

Implementing an Automated Annotation Program

 

Implementing a Non-automated Annotation Program

 

Displaying and Manipulating Annotation Objects

Example

For complete sample code, refer to the ANNOTATE example. This example realizes all objects, using the default rectangle.

L_INT AnnRealizeExample(HANNOBJECT hAnnObject, pBITMAPHANDLE pBitmap) 
{ 
   L_INT nRet; 
   HANNOBJECT RootContainer; /* Root container */ 
 
   /* Get the root container */ 
   nRet = L_AnnGetTopContainer(hAnnObject, &RootContainer); 
   if(nRet != SUCCESS) 
      return nRet; 
   /* Realize all objects */ 
   nRet = L_AnnRealize(pBitmap, NULL, RootContainer, FALSE); 
   if(nRet != SUCCESS) 
      return nRet; 
   return SUCCESS; 
} 

Help Version 20.0.2018.2.25
Products | Support | Contact Us | Copyright Notices
© 1991-2018 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Raster Imaging C API Help