RemoveRegionByName Method (GdViewer)
Removes a highlighted region specified by its name related to the document currently displayed in the GdViewer control.
These regions, if present, determines the currently defined highlighted regions on the displayed document.
'Declaration
Public Function RemoveRegionByName( _
ByVal As String _
) As GdPictureStatus
Parameters
- Name
- The name of the required region, which you have added using GdViewer.AddRegion or GdViewer.AddRegionInches methods or which you have identified using the GdViewer.SetRegionName method.
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.
How to remove one or more regions using its name.
'We assume that the GdViewer1 control has been properly integrated and your document has been properly displayed as well.
'Here we make use of the RegionSelectedByUser event.
Sub GdViewer1_RegionSelectedByUser(ByVal RegionID As Integer)
GdViewer1.SetRegionName(GdViewer1.GetRegionID(RegionID), "ToRemove")
End Sub
Sub GdViewer1_RemoveRegions()
If GdViewer1.RegionCount() > 0 Then
'Expecting some regions have been marked for removing using the RegionSelectedByUser event.
Dim status As GdPictureStatus = GdViewer1.RemoveRegionByName("ToRemove")
GdViewer1.Redraw()
If status <> GdPictureStatus.OK Then MessageBox.Show("Removing regions has failed. Status: " & status.ToString(), "GdViewer.RemoveRegionByName")
Else
MessageBox.Show("No highlighted region found related to this document. Status: " & GdViewer1.GetStat().ToString(), "GdViewer.RemoveRegionByName")
End If
End Sub
//We assume that the GdViewer1 control has been properly integrated and your document has been properly displayed as well.
//Here we make use of the RegionSelectedByUser event.
void GdViewer1_RegionSelectedByUser(int RegionID)
{
GdViewer1.SetRegionName(GdViewer1.GetRegionID(RegionID), "ToRemove");
}
void GdViewer1_RemoveRegions()
{
if (GdViewer1.RegionCount() > 0)
{
//Expecting some regions have been marked for removing using the RegionSelectedByUser event.
GdPictureStatus status = GdViewer1.RemoveRegionByName("ToRemove");
GdViewer1.Redraw();
if (status != GdPictureStatus.OK)
MessageBox.Show("Removing regions has failed. Status: " + status.ToString(), "GdViewer.RemoveRegionByName");
}
else
MessageBox.Show("No highlighted region found related to this document. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.RemoveRegionByName");
}
Reference
GdViewer Class
GdViewer Members
RegionSelectedByUser Event
RemoveRegionByID Method
RegionCount Method
GetRegionID Method
SearchText Method
AddRegion(String,Int32,Int32,Int32,Int32,ForegroundMixMode,Int32) Method
AddRegionInches(String,Single,Single,Single,Single,ForegroundMixMode,Int32) Method
RemoveAllRegions Method