L_AnnRealize

#include "l_bitmap.h"

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

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

Parameters

pBITMAPHANDLE pBitmap

Pointer to the bitmap handle referencing the bitmap to update.

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

HANNOBJECT hObject

Handle to the annotation object.

L_BOOL fRedactOnly

Flag that indicates which objects to realize. Possible values are:

Value Meaning
TRUE Realize only redaction objects
FALSE Realize any visible object.

Returns

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

Platforms

Win32, x64.

See Also

Functions

Topics

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 21.0.2023.2.15
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.