LAnnContainer::Realize

Summary

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

Syntax

#include "ltwrappr.h"

virtual L_INT LAnnContainer::Realize(pBitmap, prcBounds, bRedactOnly=TRUE)

virtual L_INT LAnnContainer::Realize(pBitmap, prcBounds, bRedactOnly=TRUE)

Parameters

pBITMAPHANDLE pBitmap

Pointer to the bitmap handle referencing the bitmap to update.

LBitmapBase * pBitmap

Pointer to the LBitmapBase object 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.

L_BOOL bRedactOnly

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

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 LAnnContainer::Unrealize.

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

When you call LAnnContainer::Realize with bRedactOnly 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 LAnnContainer::Unrealize. 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 LAnnContainer::Realize with bRedactOnly 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 LAnnContainer::Unrealize must be called each time a Redact object is unlocked.

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 LBitmapBase::ColorRes to change the image to a supported bits per pixel before calling LAnnContainer::Realize.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

This is an example for LAnnContainer::Realize(pBitmap,
prcBounds, bRedactOnly) with pBitmap of type pBITMAPHANDLE:

L_INT LAnnContainer_RealizeExample(pBITMAPHANDLE pBitmap,LAnnLine& LeadAnnLine) 
{ 
   L_INT nRet; 
 
   LAnnContainer  LeadAContainer ; 
 
   nRet = LeadAnnLine.GetTopContainer(&LeadAContainer) ; 
   if(nRet != SUCCESS) 
      return nRet; 
 
   nRet = LeadAContainer.Realize(pBitmap,NULL); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   return SUCCESS; 
} 

Help Version 22.0.2023.2.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

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