L_AnnRealize
#include "l_bitmap.h"
L_INT EXT_FUNCTION 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. This function is available in the Document/Medical Toolkits.
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
Windows 95 / 98 / Me, Windows 2000 / XP.
See Also
Functions: |
L_AnnPrint, L_AnnUnrealize, L_AnnGetLocked, L_AnnLock, L_AnnUnlock, L_AnnShowLockedIcon |
Topics: |
|
|
|
|
|
|
Example
For complete sample code, refer to the ANNOTATE example.
/* This example realizes all objects, using the default rectangle */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
void TestAnnRealize(HANNOBJECT hAnnObject)
{
HANNOBJECT RootContainer; /* Root container */
/* Get the root container */
L_AnnGetTopContainer(hAnnObject, &RootContainer);
/* Realize all objects */
L_AnnRealize(&LeadBitmap, NULL, RootContainer, FALSE);
return;
}