#include "l_bitmap.h"
L_LTANN_API L_INT L_AnnGetBitmap(hObject, pBitmap, uStructSize)
Gets the bitmap handle of the specified annotation object.
Handle to the annotation object.
Address of the variable to be updated with the handle to the annotation object's bitmap.
Size in bytes, of the structure pointed to by pBitmap
, for versioning. Use sizeof(BITMAPHANDLE).
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
The L_AnnGetBitmap function is valid only for the following object types:
Only the Stamp object uses this property. The specified bitmap is a LEAD bitmap. For a description of the Stamp object, refer to Stamp Annotation Object.
Before calling this function, you must declare a variable of data type BITMAPHANDLE. Then, pass the address of the variable in the pBitmap
parameter. This function will update the variable with the handle to the annotation object's bitmap.
The ANNOBJECT_STAMP objects (which include the Rubber Stamp tools which are available in Automation) can display text, a bitmap or a metafile. Only one of these three can be displayed at any timesetting the object to one of these destroys any settings for the other two.
Initially, the ANNOBJECT_STAMP object displays text. The difference between the Stamp and the Rubber Stamp is that initially whereas the Stamp does not display an image, the Rubber Stamp tools are set to display different metafiles (one for each rubber stamp selection).
Call the L_AnnGetPredefinedBitmap function to retrieve the bitmap displayed by the ANNOBJECT_POINT object, and the L_AnnSetPredefinedBitmap function to set the bitmap displayed by the ANNOBJECT_POINT object.
Call the L_AnnSetBitmap function to set the bitmap for one or more annotation objects.
For descriptions of the various types of objects and their properties, refer to Types of Annotations.
Required DLLs and Libraries
Win32, x64.
Create a stamp object using the example for L_AnnSetBitmap,
then call this function to retrieve the bitmap from the global stamp object
and assign it to a local stamp object.
L_INT AnnGetBitmapExample(HWND hWnd,
HANNOBJECT hContainer,/* Container annotation object */
HANNOBJECT MyStamp)
{
L_INT nRet;
HDC hWindowDC; /* Device context of the current window */
HANNOBJECT MyLocalStamp; /* Stamp annotation object */
ANNRECT ContainerRect; /* Root container's rectangle */
ANNRECT ContainerRectName;
ANNRECT MyLocalStampRect; /* Rectangle for the stamp object */
RECT rAnnBounds; /* Bounding rectangle used to draw the object */
RECT rAnnBoundsName;
BITMAPHANDLE TmpBitmap; /* Bitmap for the stamp */
hWnd;
hContainer;
MyStamp;
nRet=0;
hWindowDC; /* Device context of the current window */
MyLocalStamp; /* Stamp annotation object */
ContainerRect; /* Root container's rectangle */
ContainerRectName;
MyLocalStampRect; /* Rectangle for the stamp object */
rAnnBounds; /* Bounding rectangle used to draw the object */
rAnnBoundsName;
TmpBitmap; /* Bitmap for the stamp */
/* Get the device context of the current window */
hWindowDC = GetDC (hWnd);
TmpBitmap.uStructSize = sizeof(BITMAPHANDLE);
/* Get the bitmap for the global MyStamp object. */
nRet = L_AnnGetBitmap(MyStamp, &TmpBitmap, sizeof(BITMAPHANDLE));
if(nRet != SUCCESS)
return nRet;
/* Get the container's rectangle */
nRet = L_AnnGetRect(hContainer, &ContainerRect, &ContainerRectName);
if(nRet != SUCCESS)
return nRet;
/* Create a local stamp annotation */
nRet = L_AnnCreateItem(hContainer, ANNOBJECT_STAMP, TRUE, &MyLocalStamp);
if(nRet != SUCCESS)
return nRet;
/* Size and position the stamp, adjusting the height to keep the bitmap's aspect ratio */
MyLocalStampRect.left = ContainerRect.right * 3/5;
MyLocalStampRect.top = ContainerRect.bottom / 2;
MyLocalStampRect.right = ContainerRect.right ;
MyLocalStampRect.bottom = MyLocalStampRect.top +
(((MyLocalStampRect.right - MyLocalStampRect.left) * BITMAPHEIGHT(&TmpBitmap)) / BITMAPWIDTH(&TmpBitmap));
nRet = L_AnnSetRect(MyLocalStamp,&MyLocalStampRect);
if(nRet != SUCCESS)
return nRet;
/* Assign the bitmap retrieved from the global stamp object to the local stamp object. */
nRet = L_AnnSetBitmap(MyLocalStamp, &TmpBitmap, 0);
if(nRet != SUCCESS)
return nRet;
/* Display the stamp */
nRet = L_AnnGetBoundingRect(MyLocalStamp, &rAnnBounds, &rAnnBoundsName);
if(nRet != SUCCESS)
return nRet;
nRet = L_AnnDraw(hWindowDC, &rAnnBounds, MyLocalStamp);
if(nRet != SUCCESS)
return nRet;
/* Remove the queued paint message */
ValidateRect(hWnd, &rAnnBounds);
return SUCCESS;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document