L_AnnGetBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetBitmap(hObject, pBitmap, uStructSize)

HANNOBJECT hObject;

/* handle to the annotation object */

pBITMAPHANDLE pBitmap;

/* address of the variable to be updated */

L_UINT uStructSize;

/* size in bytes, of the structure pointed to by pBitmap */

Gets the bitmap handle of the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter

Description

hObject

Handle to the annotation object.

pBitmap

Address of the variable to be updated with the handle to the annotation object's bitmap.

uStructSize

Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

The L_AnnGetBitmap function is valid only for the following object types:

image\sqrblit.gif ANNOBJECT_POINT

image\sqrblit.gif ANNOBJECT_PUSHPIN

image\sqrblit.gif ANNOBJECT_STAMP

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 time—setting 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

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_AnnSetBitmap

Topics:

Annotation Functions: Object Properties

 

Annotation Objects - Default Values

 

Annotation Objects - Automated Features

 

Implementing an Automated Annotation Program

 

Implementing a Non-automated Annotation Program

 

Obtaining Annotation Object Information

 

Using Annotation Bitmap Objects

 

Annotation Functions (Document/Medical only): Getting and Setting the Object Bitmap Property

Example

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.

BITMAPHANDLE LeadBitmap;   /* Bitmap handle for the image */
HANNOBJECT hContainer; /* Container annotation object */
HANNOBJECT MyStamp;
void TestAnnGetBitmap(HWND hWnd)
{
   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 */
   /* Get the device context of the current window */
   hWindowDC = GetDC (hWnd);

   /* Get the bitmap for the global MyStamp object. */
   L_AnnGetBitmap(MyStamp, &TmpBitmap, sizeof(BITMAPHANDLE));

   /* Get the container's rectangle */
   L_AnnGetRect(hContainer, &ContainerRect, &ContainerRectName);
   /* Create a local stamp annotation */
   L_AnnCreateItem(hContainer, ANNOBJECT_STAMP, TRUE, &MyLocalStamp);
   /* 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));
   L_AnnSetRect(MyLocalStamp,&MyLocalStampRect);
   /* Assign the bitmap retrieved from the global stamp object to the local stamp object and free the temporary bitmap. */
   L_AnnSetBitmap(MyLocalStamp, &TmpBitmap, 0);
   L_FreeBitmap(&TmpBitmap);
   /* Display the stamp */
   L_AnnGetBoundingRect(MyLocalStamp, &rAnnBounds, &rAnnBoundsName);
   L_AnnDraw(hWindowDC, &rAnnBounds, MyLocalStamp);
   /* Remove the queued paint message */
   ValidateRect(hWnd, &rAnnBounds);
   return;
}