GetRegionID Method (GdViewer)
In This Topic
Returns the unique region identifier of a highlighted region specified by its sequence index related to the document currently displayed in the GdViewer control. You always have to apply this identifier when working with highlighted regions.
These regions, if present, determines the currently defined highlighted regions on the displayed document.
Syntax
'Declaration
Public Function GetRegionID( _
ByVal As Integer _
) As Integer
public int GetRegionID(
int
)
public function GetRegionID(
: Integer
): Integer;
public function GetRegionID(
: int
) : int;
public: int GetRegionID(
int
)
public:
int GetRegionID(
int
)
Parameters
- RegionNo
- The sequence index of the required highlighted region related to the currently displayed document. It must be a value from 1 to RegionCount.
Return Value
A unique region identifier of a specified region. The
GetStat method can be subsequently used to determine if this method has been successful.
Example
How to find out the region's unique identifier and how to properly used it further.
'We assume that the GdViewer1 control has been properly integrated and your document has been properly displayed as well.
'To successfully follow this example, please use the code snippet attached to AddRegion or AddRegionInches methods
'to define highlighted regions or define some highlighted regions using SearchText methods by yourself.
Dim regID As Integer = 0, regCount As Integer = GdViewer1.RegionCount()
If regCount > 0 Then
Dim message As String = "The number of regions: " + regCount.ToString()
For j As Integer = 1 To regCount
regID = GdViewer1.GetRegionID(j)
message = message + vbCrLf + "regID: " + regID.ToString() + " prev.name: " + GdViewer1.GetRegionName(regID) + " current name: "
GdViewer1.SetRegionName(regID, "Region" + regID.ToString())
message += GdViewer1.GetRegionName(regID)
Next
MessageBox.Show(message, "GdViewer.GetRegionID")
Else
MessageBox.Show("No highlighted region found related to this document. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.GetRegionID")
End If
//We assume that the GdViewer1 control has been properly integrated and your document has been properly displayed as well.
//To successfully follow this example, please use the code snippet attached to AddRegion or AddRegionInches methods
//to define highlighted regions or define some highlighted regions using SearchText methods by yourself.
int regID = 0, regCount = GdViewer1.RegionCount();
if (regCount > 0)
{
string message = "The number of regions: " + regCount.ToString();
for (int j = 1; j <= regCount; j++)
{
regID = GdViewer1.GetRegionID(j);
message = message + "\nregID: " + regID.ToString() + " prev.name: " + GdViewer1.GetRegionName(regID) + " current name: ";
GdViewer1.SetRegionName(regID, "Region" + regID.ToString());
message += GdViewer1.GetRegionName(regID);
}
MessageBox.Show(message, "GdViewer.GetRegionID");
}
else
MessageBox.Show("No highlighted region found related to this document. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.GetRegionID");
Example
How to find out the region's unique identifier and how to properly used it further.
'We assume that the GdViewer1 control has been properly integrated and your document has been properly displayed as well.
'To successfully follow this example, please use the code snippet attached to AddRegion or AddRegionInches methods
'to define highlighted regions or define some highlighted regions using SearchText methods by yourself.
Dim regID As Integer = 0, regCount As Integer = GdViewer1.RegionCount()
If regCount > 0 Then
Dim message As String = "The number of regions: " + regCount.ToString()
For j As Integer = 1 To regCount
regID = GdViewer1.GetRegionID(j)
message = message + vbCrLf + "regID: " + regID.ToString() + " prev.name: " + GdViewer1.GetRegionName(regID) + " current name: "
GdViewer1.SetRegionName(regID, "Region" + regID.ToString())
message += GdViewer1.GetRegionName(regID)
Next
MessageBox.Show(message, "GdViewer.GetRegionID")
Else
MessageBox.Show("No highlighted region found related to this document. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.GetRegionID")
End If
//We assume that the GdViewer1 control has been properly integrated and your document has been properly displayed as well.
//To successfully follow this example, please use the code snippet attached to AddRegion or AddRegionInches methods
//to define highlighted regions or define some highlighted regions using SearchText methods by yourself.
int regID = 0, regCount = GdViewer1.RegionCount();
if (regCount > 0)
{
string message = "The number of regions: " + regCount.ToString();
for (int j = 1; j <= regCount; j++)
{
regID = GdViewer1.GetRegionID(j);
message = message + "\nregID: " + regID.ToString() + " prev.name: " + GdViewer1.GetRegionName(regID) + " current name: ";
GdViewer1.SetRegionName(regID, "Region" + regID.ToString());
message += GdViewer1.GetRegionName(regID);
}
MessageBox.Show(message, "GdViewer.GetRegionID");
}
else
MessageBox.Show("No highlighted region found related to this document. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.GetRegionID");
See Also
Reference
GdViewer Class
GdViewer Members
RegionCount Method
GetStat Method
RegionCount Method
RemoveRegionByID Method
RemoveAllRegions Method
AddRegion(String,Int32,Int32,Int32,Int32,ForegroundMixMode,Int32) Method
AddRegionInches(String,Single,Single,Single,Single,ForegroundMixMode,Int32) Method
SearchText(String,Int32,Boolean) Method