GetRegionName Method (GdViewer)
In This Topic
Gets the name of a highlighted region specified by its unique identifier related to the document currently displayed in the GdViewer control. These regions, if present, determines the currently defined highlighted regions on the displayed document.
You can define the name of each highlighted region when adding regions using the AddRegion(String,Double,Double,Double,Double,Color,RegionFillMode) method or directly using the SetRegionName method.
Syntax
'Declaration
Public Function GetRegionName( _
ByVal As Integer _
) As String
public string GetRegionName(
int
)
public function GetRegionName(
: Integer
): String;
public function GetRegionName(
: int
) : String;
public: string* GetRegionName(
int
)
public:
String^ GetRegionName(
int
)
Parameters
- RegionID
- A unique region identifier of the specified region. You can obtain this identifier using the GetRegionID method or when creating regions using the AddRegion(String,Double,Double,Double,Double,Color,RegionFillMode) method.
Return Value
The name of the specified region. The
GetStat method can be subsequently used to determine if this method has been successful.
Example
How to find out the name of the highlighted region.
'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 the AddRegion method 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 = 0 To regCount-1
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.GetRegionName")
Else
MessageBox.Show("No highlighted region found related to this document. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.GetRegionName")
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 the AddRegion method 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 = 0; j < regCount-1; 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.GetRegionName");
}
else
MessageBox.Show("No highlighted region found related to this document. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.GetRegionName");
Example
How to find out the name of the highlighted region.
'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 the AddRegion method 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 = 0 To regCount-1
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.GetRegionName")
Else
MessageBox.Show("No highlighted region found related to this document. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.GetRegionName")
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 the AddRegion method 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 = 0; j < regCount-1; 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.GetRegionName");
}
else
MessageBox.Show("No highlighted region found related to this document. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.GetRegionName");
See Also
Reference
GdViewer Class
GdViewer Members
AddRegion(String,Double,Double,Double,Double,Color,RegionFillMode) Method
SetRegionName Method
GetRegionID Method
AddRegion(String,Double,Double,Double,Double,Color,RegionFillMode) Method
SearchText(String,Int32,Boolean) Method
GetStat Method
SetRegionName Method
RegionCount Method
GetRegionID Method
SearchText(String,Int32,Boolean) Method
SearchText(String,Int32,Boolean,Boolean) Method
AddRegion(String,Double,Double,Double,Double,Color,RegionFillMode) Method