virtual L_INT LAnnotation::CutToClipboard(uFormat=ANNFMT_XML, bSelected=FALSE, bEmpty=FALSE, fCheckMenu=FALSE)
Cuts the annotation object to the Windows clipboard in either the native format or WMF format.
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. |
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. |
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. |
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. |
| Value | Meaning |
|---|---|
| SUCCESS | The function was successful. |
| < 1 | An error occurred. Refer to Return Codes. |
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.
You can copy data from the clipboard to a container using LAnnContainer::CopyFromClipboard.
The object is invalidated after the functions returns.
Win32, x64.
L_INT LAnnotation_CutToClipboardExample(LAnnotation& LeadAnn,HWND hWnd,HDC hdcPrinter){L_INT nRet;if (LeadAnn.IsClipboardReady() == TRUE){ANNPOINT AnnPt ;HANNOBJECT hAnnObject ;LAnnotation *pMyAnn ;HDC hDC ;RECT Rect ;nRet = LeadAnn.CutToClipboard() ;if(nRet != SUCCESS)return nRet;nRet = LeadAnn.GetTopContainer(&hAnnObject) ;if(nRet != SUCCESS)return nRet;//...//...pMyAnn = LeadAnn.CreateAnnObject(hAnnObject) ;hDC = GetDC(hWnd) ;nRet = pMyAnn->GetBoundingRect(&Rect) ;if(nRet != SUCCESS)return nRet;nRet = pMyAnn->Draw(hDC,&Rect);if(nRet != SUCCESS)return nRet;ReleaseDC(hWnd,hDC) ;if (pMyAnn->IsVisible() == FALSE){nRet = pMyAnn->SetVisible(TRUE) ;if(nRet != SUCCESS)return nRet;}AnnPt.x = 30 ;AnnPt.y = 30 ;nRet = pMyAnn->Flip(&AnnPt) ;if(nRet != SUCCESS)return nRet;//...//...AnnPt.x -= 10 ;nRet = pMyAnn->Reverse(&AnnPt) ;if(nRet != SUCCESS)return nRet;nRet = pMyAnn->Resize((L_DOUBLE) 0.5,(L_DOUBLE) 0.5, &AnnPt, ANNFLAG_RECURSE);if(nRet != SUCCESS)return nRet;nRet = pMyAnn->Rotate(90,&AnnPt) ;if(nRet != SUCCESS)return nRet;// print MyAnn to printernRet = pMyAnn->Print(hdcPrinter,&Rect) ;if(nRet != SUCCESS)return nRet;nRet = pMyAnn->Remove() ;if(nRet != SUCCESS)return nRet;}elsereturn FAILURE;return SUCCESS;}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
