System.Windows.Forms.Clipboard.SetImage Method

Clears the Clipboard and then adds an System.Drawing.Image in the DataFormats.Bitmap format.

Syntax

public static void SetImage (System.Drawing.Image image)

Parameters

image
The System.Drawing.Image to add to the Clipboard.

Remarks

To retrieve image data from the Clipboard, first use the Clipboard.ContainsImage method to determine whether the Clipboard contains image data before retrieving it with the Clipboard.GetImage method.

Note:

The System.Windows.Forms.Clipboard class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your Main method is marked with the STAThreadAttribute attribute.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0