Example





In This Topic
GdPicture14 Namespace / GdViewer Class / DisplayFromClipboard Method

DisplayFromClipboard Method (GdViewer)

In This Topic
Loads an image, which is currently stored in the clipboard, and then displays it in the GdViewer control. The document previously displayed in the control will automatically close.

The BeforeDocumentChange and the AfterDocumentChange events are raised just before and right after the image is displayed in the GdViewer control. Both events are only raised if the image has been successfully loaded.

Syntax
'Declaration
 
Public Function DisplayFromClipboard() As GdPictureStatus
public GdPictureStatus DisplayFromClipboard()
public function DisplayFromClipboard(): GdPictureStatus; 
public function DisplayFromClipboard() : GdPictureStatus;
public: GdPictureStatus DisplayFromClipboard(); 
public:
GdPictureStatus DisplayFromClipboard(); 

Return Value

A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK. We strongly recommend always checking this status first.
Remarks
Be aware that this method loads only images previously copied into the clipboard, for other data stored in the clipboard the method will fail.

Just to remind you that both the BeforeDocumentChange and the AfterDocumentChange events are raised using this method.

Example
How to display the image copied in the clipboard.
'We assume that the GdViewer1 control has been properly integrated.
If GdViewer1.DisplayFromClipboard() = GdPictureStatus.OK Then
    'Do your stuff here.
Else
    MessageBox.Show("No image data are stored in the clipboard.", "GdViewer.DisplayFromClipboard")
End If
//We assume that the GdViewer1 control has been properly integrated.
if (GdViewer1.DisplayFromClipboard() == GdPictureStatus.OK)
{
    //Do your stuff here.
}
else
{
    MessageBox.Show("No image data are stored in the clipboard.", "GdViewer.DisplayFromClipboard");
}
See Also