LAnnotation::CopyToClipboard

Summary

Copies the annotation object to the Windows clipboard in either the native format or WMF format.

Syntax

#include "ltwrappr.h"

virtual L_INT LAnnotation::CopyToClipboard(uFormat=ANNFMT_XML, bSelected=FALSE, bEmpty=FALSE, fCheckMenu=FALSE)

Parameters

L_UINT uFormat

Format for the annotation data. Possible values are:

Value Meaning
ANNFMT_WMF Use the Windows WMF format.
ANNFMT_XML Use the XML format. This is the default value.

L_BOOL 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.

L_BOOL 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.

L_BOOL 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

Value Meaning
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:

To copy only selected objects in a container, set bSelected to TRUE.

To copy all objects in a container, set bSelected to FALSE.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

L_INT LAnnotation_CopyToClipboardExample(LAnnotation& LeadAnn,HWND hWnd) 
{   
   L_INT nRet; 
   if (LeadAnn.IsClipboardReady() == TRUE) 
   {     
      LAnnContainer  LeadAContainer ; 
      ANNPOINT       AnnPoint ; 
 
      nRet = LeadAnn.GetTopContainer(&LeadAContainer) ; 
      if(nRet != SUCCESS) 
         return nRet; 
      nRet = LeadAnn.CopyToClipboard() ; 
      if(nRet != SUCCESS) 
         return nRet; 
 
      nRet = LeadAnn.Destroy() ; 
      if(nRet != SUCCESS) 
         return nRet; 
 
      //... 
 
      AnnPoint.x = 30 ; 
      AnnPoint.y = 30 ; 
 
      nRet = LeadAContainer.CopyFromClipboard(hWnd) ; 
      if(nRet != SUCCESS) 
         return nRet; 
      nRet = LeadAContainer.Flip(&AnnPoint) ; 
      if(nRet != SUCCESS) 
         return nRet; 
   } 
   else 
      return FAILURE; 
 
   return SUCCESS; 
} 
Help Version 22.0.2023.2.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.