L_AnnCreate

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnCreate(uObjectType, phObject)

L_UINT uObjectType;

/* type of annotation object to create */

pHANNOBJECT phObject;

/* address of the variable to be updated */

Creates an annotation object of the specified type. This function is available in the Document/Medical Toolkits.

Parameter

Description

uObjectType

The type of annotation object to create. For descriptions of object types, refer to Types of Annotations.

phObject

Address of the variable to be updated with the handle to the new annotation object.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

(Document/Medical) Before calling this function, you must declare a variable of data type HANNOBJECT. Then, pass the address of the variable in the phObject parameter. This function will update the variable with the handle of the new annotation object.

You must use the L_AnnSet... functions to initialize the object after it is created.

You should not call this function during processing of WM_LTANNEVENT if wParam equals LTANNEVENT_REMOVE or LTANNEVENT_INSERT, or during the ANNENUMCALLBACK callback function

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_AnnCreateContainer, L_AnnCreateItem,

 

L_AnnDefine, L_AnnInsert, L_AnnRemove,

 

L_AnnDestroy, L_AnnAddUserHandle, L_AnnAdjustPoint, L_AnnChangeUserHandle, L_AnnConvert, L_AnnDefine2, L_AnnDeleteUserHandle, L_AnnEnumerateHandles, L_AnnGetRestrictToContainer, L_AnnGetRotateAngle, L_AnnGetUserHandle, L_AnnGetUserHandles, L_AnnHitTestExt, L_AnnRestrictCursor, L_AnnSetRestrictToContainer

Topics:

Annotation Functions: Creating and Deleting Annotations

 

Implementing Annotations

 

Annotation Objects - Default Values

 

Annotation Objects - Automated Features

 

Types of Annotations

 

Implementing an Automated Annotation Program

 

Implementing a Non-automated Annotation Program

 

Implementing Custom Annotations

Example

For complete sample code, refer to the ANNOTATE example.

/* This example creates a line object, inserts it into the existing container, and displays the line */
/*This function must be called AFTER a container has been created.  For example, after TestCreateAnn in Implementing a Non-automated Annotation Program. */
BITMAPHANDLE LeadBitmap;   /* Bitmap handle for the image */
HANNOBJECT hContainer; /* Container annotation object */
HANNOBJECT MyLine; /* Line annotation object */

void TestCreateLineAnn(HWND hWnd)
{
   HDC hWindowDC;  /* Device context of the current window */
   ANNRECT ContainerRect;
   ANNRECT ContainerRectName;
   ANNPOINT MyLinePts[2];
   pANNPOINT pMyLinePts = MyLinePts;
   RECT rAnnBounds;
   RECT rAnnBoundsName;

   /* Get the device context of the current window */
   hWindowDC = GetDC (hWnd);
   /* Create the Line Annotation and insert it into the container */
   L_AnnCreate(ANNOBJECT_LINE, &MyLine);
   L_AnnInsert(hContainer, MyLine, FALSE);
   L_AnnSetVisible(MyLine, TRUE, 0, NULL);
   /* Get the container rectangle to use for positioning the line */
   L_AnnGetRect(hContainer, &ContainerRect, &ContainerRectName);
   /* Position the line */
   pMyLinePts[0].x = 0;
   pMyLinePts[0].y = 0;
   pMyLinePts[1].x = ContainerRect.right / 2;
   pMyLinePts[1].y = ContainerRect.bottom / 2;
   L_AnnSetPoints(MyLine, pMyLinePts, 2);
   /* Display the line */
   L_AnnGetBoundingRect(MyLine, &rAnnBounds, &rAnnBoundsName);
   L_AnnDraw(hWindowDC, &rAnnBounds, MyLine);
   /* Remove the queued paint message */
   ValidateRect(hWnd, &rAnnBounds);
   ReleaseDC(hWnd, hWindowDC);
   return;
}