L_AnnCopyToClipboard

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnCopyToClipboard(hObject, uFormat, fSelected, fEmpty, fCheckMenu)

HANNOBJECT hObject;

/* handle to the annotation object */

L_UINT uFormat;

/* constant for the clipboard format */

L_BOOL fSelected;

/* flag that indicates which objects to copy */

L_BOOL fEmpty;

/* flag that indicates whether to empty the clipboard prior to copying data to it */

L_BOOL fCheckMenu;

/* flag that indicates whether to check the automation menu */

Copies the specified annotation objects to the Windows clipboard in either the native format or WMF format. This function is available in both the (Document/Medical) toolkits.

Parameter

Description

hObject

Handle to the annotation object.

uFormat

Format for the annotation data. Possible values are:

 

Value

Meaning

 

ANNFMT_NATIVE

Use LEAD's own format for annotations.

 

ANNFMT_WMF

Use the Windows WMF format.

 

ANNFMT_ENCODED

Copy as a binary format.

 

ANNFMT_XML

Use the XML text format. This is LEAD’s new text-based format which is upward-compatible.

fSelected

Flag that indicates whether to copy all selected objects, or just the specified object. Possible values are:

 

Value

Meaning

 

TRUE

Copy all objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.

 

FALSE

Copy only the specified object.

fEmpty

Flag that indicates whether to empty the clipboard prior to copying the annotation data to it. Possible values are:

 

Value

Meaning

 

TRUE

Empty the clipboard before copying data to it.

 

FALSE

Add to the existing data on the clipboard.

fCheckMenu

Flag that indicates whether check the automation menu to see if ANNAUTOTEXT_MENU_COPY has been checked. Possible values are:

 

Value

Meaning

 

TRUE

Check the automation menu to see if ANNAUTOTEXT_MENU_COPY has been checked for the specified object. Only those objects with ANNAUTOTEXT_MENU_COPY checked will be copied.

 

FALSE

Do not check the automation menu to see if ANNAUTOTEXT_MENU_COPY has been checked for the specified object. The copied objects are determined by fSelected only.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

(Document/Medical) Use the WMF format only for copying for use in another application.

To retain scaling and positioning information, this function always copies the root container, along with the specified object or selected objects. Use the hObject and fSelected parameters as follows:

image\sqrblit.gif To copy the specified object, set hObject to that object and set fSelected to FALSE.

image\sqrblit.gif To copy only selected objects in a container, set hObject to the container and set fSelected to TRUE.

image\sqrblit.gif To copy all objects in a container, set hObject to the container and set fSelected to FALSE.

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_AnnCopy, L_AnnCopyFromClipboard,

 

L_AnnCutToClipboard, L_AnnClipboardReady

Topics:

Annotation Functions: Creating and Deleting Annotations

 

Implementing Annotations

 

Implementing an Automated Annotation Program

 

Implementing a Non-automated Annotation Program

 

Using Rulers in Annotation Objects

Example

/* This example copies all annotations to the clipboard */
void TestAnnCopyTo(HANNOBJECT hAnnObject)
{
   HANNOBJECT TopContainer; /* Root container */
   int nRet;
   /* Get the root container */
   L_AnnGetTopContainer(hAnnObject, &TopContainer);
   /* Copy all annotations to the clipboard */
   nRet = L_AnnCopyToClipboard(TopContainer, ANNFMT_NATIVE, FALSE, TRUE, FALSE);
   if (nRet == SUCCESS)
      MessageBox(NULL, TEXT("Annotations copied."), TEXT("Notice"), MB_OK);
   return;
}