GdPicture.NET Reference Guide
ResetROI Method (GdPictureImaging)
Example 





GdPicture14 Namespace > GdPictureImaging Class : ResetROI Method
Resets the region of interest (ROI). The method simply clears the coordinates and the dimensions of the ROI used by this GdPictureImaging object.
Syntax
'Declaration
 
Public Sub ResetROI() 
public void ResetROI()
public procedure ResetROI(); 
public function ResetROI();
public: void ResetROI(); 
public:
void ResetROI(); 
Remarks
Be aware that this method does not reset the previously set error status.
Example
How to reset (clear) a previously used ROI of the processed image.
Dim caption As String = "Example: ResetROI"
Using oImage As GdPictureImaging = New GdPictureImaging()
    Dim imageID As Integer = oImage.CreateGdPictureImageFromFile("image.png")
    If oImage.GetStat() = GdPictureStatus.OK Then
        oImage.SetROI(50, 50, 100, 100)
        oImage.FxAddNoise(imageID)
        oImage.SetROI(150, 50, 100, 100)
        oImage.FxAddNoise(imageID)
        oImage.ResetROI()
        If oImage.SaveAsPNG(imageID, "image with noise.png") = GdPictureStatus.OK Then
            MessageBox.Show("The image has been saved successfully.", caption)
        Else
            MessageBox.Show("The image can't be saved. Status: " + oImage.GetStat().ToString(), caption)
        End If
        oImage.ReleaseGdPictureImage(imageID)
    Else
        MessageBox.Show("The image can't be created. Status: " + oImage.GetStat().ToString(), caption)
    End If
End Using
string caption = "Example: ResetROI";
using (GdPictureImaging oImage = new GdPictureImaging())
{
    int imageID = oImage.CreateGdPictureImageFromFile("image.png");
    if (oImage.GetStat() == GdPictureStatus.OK)
    {
        oImage.SetROI(50, 50, 100, 100);
        oImage.FxAddNoise(imageID);
        oImage.SetROI(150, 50, 100, 100);
        oImage.FxAddNoise(imageID);
        oImage.ResetROI();
        if (oImage.SaveAsPNG(imageID, "image with noise.png") == GdPictureStatus.OK)
            MessageBox.Show("The image has been saved successfully.", caption);
        else
            MessageBox.Show("The image can't be saved. Status: " + oImage.GetStat().ToString(), caption);
        oImage.ReleaseGdPictureImage(imageID);
    }
    else
        MessageBox.Show("The image can't be created. Status: " + oImage.GetStat().ToString(), caption);
}
See Also

Reference

GdPictureImaging Class
GdPictureImaging Members
SetROI Method