'We assume that the GdViewer1 control has been properly integrated and your document has been properly displayed as well.
Dim regID As Integer = 0, regCount As Integer = GdViewer1.RegionCount()
If regCount > 0 Then
'Expecting some regions have been marked as selected.
Dim status As GdPictureStatus = GdPictureStatus.OK
For j As Integer = 1 To regCount
regID = GdViewer1.GetRegionID(j)
If GdViewer1.GetRegionSelected(regID) Then
status = GdViewer1.RemoveRegionByID(regID)
If status <> GdPictureStatus.OK Then Exit For
End If
Next
GdViewer1.Redraw()
If status <> GdPictureStatus.OK Then MessageBox.Show("Removing regions has failed. Status: " + status.ToString(), "GdViewer.GetRegionSelected")
Else
MessageBox.Show("No highlighted region found related to this document. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.GetRegionSelected")
End If
//We assume that the GdViewer1 control has been properly integrated and your document has been properly displayed as well.
int regID = 0, regCount = GdViewer1.RegionCount();
if (regCount > 0)
{
//Expecting some regions have been marked as selected.
GdPictureStatus status = GdPictureStatus.OK;
for (int j = 1; j <= regCount; j++)
{
regID = GdViewer1.GetRegionID(j);
if (GdViewer1.GetRegionSelected(regID))
{
status = GdViewer1.RemoveRegionByID(regID);
if (status != GdPictureStatus.OK)
break;
}
}
GdViewer1.Redraw();
if (status != GdPictureStatus.OK)
MessageBox.Show("Removing regions has failed. Status: " + status.ToString(), "GdViewer.GetRegionSelected");
}
else
MessageBox.Show("No highlighted region found related to this document. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.GetRegionSelected");