System.Windows.Forms.Clipboard.GetImage Method

Retrieves an image from the Clipboard.

Syntax

public static System.Drawing.Image GetImage ()

Returns

An System.Drawing.Image representing the Clipboard image data or null if the Clipboard does not contain any data that is in the DataFormats.Bitmap format or can be converted to that format.

Remarks

Use the Clipboard.ContainsImage method to determine whether the Clipboard contains image data before retrieving it with this method.

Use the Clipboard.SetImage(System.Drawing.Image) method to add image data to the Clipboard.

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