LAnnotation::CutToClipboard

#include "ltwrappr.h"

virtual L_INT LAnnotation::CutToClipboard(uFormat=ANNFMT_NATIVE, bSelected=FALSE, bEmpty=FALSE, fCheckMenu=FALSE)

L_UINT uFormat;

/* format for the annotation data */

L_BOOL bSelected;

/* flag that indicates whether to copy all selected objects, or just the specified object */

L_BOOL bEmpty;

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

L_BOOL fCheckmenu;

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

Cuts the annotation object to the Windows clipboard in either the native format or WMF format. This function is available in the Document/Medical Toolkits.

Parameter

Description

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

Use the LEAD binary format. This file size is smaller and is upward compatible. It also provides better security.

 

ANNFMT_XML

Use the XML format.

bSelected

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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected functions.

 

FALSE

Copy only the specified object.

bEmpty

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

Use the WMF format only for copying for use in another application.

If the annotation object is a container, then to retain scaling and positioning information, this function will always copy the root container, along with the specified object or selected objects. Use the bSelected parameter as follows:

image\sqrblit.gif To copy only selected objects in a container, set bSelected to TRUE.

image\sqrblit.gif To copy all objects in a container, set bSelected to FALSE.

You can copy data from the clipboard to a container using LAnnContainer::CopyFromClipboard.

The object is invalidated after the functions returns.

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.

See Also

Functions:

Class Members

Topics:

Annotation Functions: Creating and Deleting Annotations

 

Implementing Annotations

 

Displaying and Manipulating Annotation Objects

Example

L_VOID TestClipboard(LAnnotation& LeadAnn,HWND hWnd,HDC hdcPrinter)
{
   if (LeadAnn.IsClipboardReady() == TRUE)
   {
      ANNPOINT AnnPt ;
      HANNOBJECT hAnnObject ;
      LAnnotation L_FAR *pMyAnn ;
      HDC hDC ;
      RECT Rect ;

      LeadAnn.CutToClipboard() ;
      
      LeadAnn.GetTopContainer(&hAnnObject) ;
      //...
      //...

      pMyAnn = LeadAnn.CreateAnnObject(hAnnObject) ;
      
      hDC = GetDC(hWnd) ;

      pMyAnn->GetBoundingRect(&Rect) ;
      pMyAnn->Draw(hDC,&Rect);

      ReleaseDC(hWnd,hDC) ;

      if (pMyAnn->IsVisible() == FALSE)
         pMyAnn->SetVisible(TRUE) ;

      AnnPt.x = 30 ;
      AnnPt.y = 30 ;

      pMyAnn->Flip(&AnnPt) ;

      //...
      //...

      AnnPt.x -= 10 ;
      pMyAnn->Reverse(&AnnPt) ;
      pMyAnn->Resize((L_DOUBLE) 0.5,(L_DOUBLE) 0.5, &AnnPt, ANNFLAG_RECURSE); 
      pMyAnn->Rotate(90,&AnnPt) ;
      
      // print MyAnn to printer 
      pMyAnn->Print(hdcPrinter,&Rect) ;

      pMyAnn->Remove() ;
   }  
}