GdPicture.NET Reference Guide
Clear Method (GdViewer)
Example 





GdPicture14.WPF Namespace > GdViewer Class : Clear Method
Clears the GdViewer control, in other words, erases the displayed document from the control. This method only cleans up the displayed area of the GdViewer control, it does not close the loaded document. It also clears the rectangle of area selection, if any is defined, using the ClearRect method internally. You can display the loaded document using the Redraw method again.
Syntax
'Declaration
 
Public Sub Clear() 
public void Clear()
public procedure Clear(); 
public function Clear();
public: void Clear(); 
public:
void Clear(); 
Remarks
Please, be aware that the currently displayed document is not closed using this method.
Example
How to clear the current viewer control.
'We assume that the GdViewer1 control has been properly integrated.
If GdViewer1.DisplayFromFile("") = GdPictureStatus.OK Then
    'Do your stuff here ...
    GdViewer1.Clear()
    '...
    If GdViewer1.Redraw() <> GdPictureStatus.OK Then
        MessageBox.Show("The file can't be redrawn. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.Clear")
    End If
End If
//We assume that the GdViewer1 control has been properly integrated.
if (GdViewer1.DisplayFromFile("") == GdPictureStatus.OK)
{
    //Do your stuff here ...
    GdViewer1.Clear();
    //...
    if (GdViewer1.Redraw() != GdPictureStatus.OK)
        MessageBox.Show("The file can't be redrawn. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.Clear");
}
See Also

Reference

GdViewer Class
GdViewer Members
Redraw Method
ClearRect Method
CloseDocument Method