Description

Returns a new instance of an IDataObject that holds a snapshot of the current display in the requested CF_ types.

Return Type

An Unknown object.  

A new instance of an McDataObject holding a snapshot of the current display in the requested formats.

Syntax

object.CreateDataObject (CF_Types)

The CreateDataObject Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McDisplay.
CF_TypesRequired. A mcWhatCF_Types enumeration, as described in settings.

mcWhatCF_Types : The format(s) in which to render the data. Currently RegisterClipboardFormat("%McDisplay:IQL~McDisplay% Image Aoi"), RegisterClipboardFormat("%McDisplay:IQL~McDisplay% %Image Display:IQL~Image Display% Area"), CF_ENHMETAFILE, CF_DIB and CF_METAFILEPICT, are supported for the CLIPBOARDFORMAT cfFormat FORMATETC field (see Notes); they are enumerated in that order for IDataObject.EnumFormatEtc. These formats correspond to CF_TypesmcwcftMcImageAoi, mcwcftMcImageDisplayArea, mcwcftCF_ENHMETAFILE, mcwcftCF_DIB, mcwcftCF_METAFILEPICT respectively. The mcWhatCF_Types may be OR'ed together to create an IDataObject holding multiple types, but this is generally quite costly, since the rendered data can be very large. Additionally, mcwcftCF_EMBEDDEDOBJECT may be specified to place an embedded OLE object holding the bounds of the AOI on the clipboard.

Settings

The settings for CF_Types are:

ConstantValueDescription
 mcwcftNone0

No clipboard format bits

 mcwcftMcImageAoi1

Private format holding the image area under the AOI of the ImageToDisplay

 mcwcftMcImageDisplayArea2

Private format holding the displayed portion of the ImageToDisplay

 mcwcftCF_ENHMETAFILE16

Enhanced Metafile (EMF) format

 mcwcftCF_DIB32

Device Independent Bitmap (DIB) format

 mcwcftCF_BITMAP64

Device-dependent BITMAP format. This is legal only for the EditGetClipboardImage method. If you want to save a bitmap format to the clipboard, use mcwcftCF_DIB instead.

 mcwcftCF_EMBEDDEDOBJECT128

A format holding the image area under the AOI as an “IQApp Image Document” embedded OLE object.

 mcwcftCF_METAFILEPICT256

Windows Metafile (WMF) format

Remarks

This IDataObject would be used for clipboard cut/copy operations, where the clipboard uses delayed rendering to get access to the data.

Notes

Unlike the DataObject property, which always provides the current display when IDataObject.GetData is called, the IDataObject returned from the CreateDataObject call is a new, independent object and subsequent changes to the image or overlays will have no effect on it. Thus, use this method to “capture” a display state for use at some later time.

When supplying a FORMATETC structure for IDataObject.GetData or QueryGetData, only the cfFormat field, and optionally the tymed field, are significant for determining if the requested format is available. If the tymed field is TYMED_NULL (0) then an available format with any tymed will match.

The FORMATETC DVTARGETDEVICE* ptd field is significant only when GetData is called for a CF_ENHMETAFILE cfFormat, where it is used to create the reference device context for drawing the metafile; otherwise, ptd should be set to NULL. The dwAspect field should be set to DVASPECT_CONTENT (1) and the lindex field should be set to -1.