Ink.ClipboardPaste Method

Ink.ClipboardPaste Method

Pastes the specified IDataObject Leave Site to the specified point in this Ink object.

Definition

Visual Basic .NET Public Function ClipboardPaste( _
ByVal pt As Point, _
ByVal dataObject As Object _
) As Strokes
C# public Strokes ClipboardPaste(
Point pt,
object dataObject
);
Managed C++ public: Strokes* ClipboardPaste(
Point *pt,
Object *dataObject
);

Parameters

pt System.Drawing.Point. The point to paste to, in ink space coordinates. The default value is {0, 0}.
dataObject System.Object. The IDataObject Leave Site to paste into this Ink object.

Return Value

Microsoft.Ink.Strokes. Returns the Strokes collection that is pasted to the Ink object.

Exceptions

ObjectDisposedException Leave Site: The Ink object is disposed.
ThreadStateException Leave Site:

Remarks

An exception is thrown if an unexpected error occurs while accessing the Clipboard Leave Site. If no error occurs but the Clipboard Leave Site does not contain a format that can be pasted into an Ink object—either ink serialized format (ISF) or tInk—then this method returns null (Nothing in Microsoft® Visual Basic® .NET) and no exception is thrown.

Important Security InformationSecurity Alert: If using under partial trust, this method requires UIPermissionClipboard.AllClipboard Leave Site permission. See Security And Trust for more information.

Examples

This C# example pastes an IDataObject Leave Site, theDataObject, to an InkCollector, theInkCollector, at position (100, 100), in ink space coordinates.

try
{
    theInkCollector.Ink.ClipboardPaste(new Point(100, 100), theDataObject);
}
catch
{
    // Exception handling code goes here.
}

This Visual Basic .NET example pastes an IDataObject Leave Site, theDataObject, to an InkCollector, theInkCollector, at position (100, 100), in ink space coordinates.

Try
    Dim origin As New Point(100, 100)
    theInkCollector.Ink.ClipboardPaste(origin, theDataObject)
Catch
    'Exception handling code goes here.
End Try

See Also