SetRegionBorderColor(Int32,Color) Method
In This Topic
Sets the border color 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 determine the border color of each highlighted region using the GetRegionBorderColor method.
Syntax
'Declaration
Public Overloads Function SetRegionBorderColor( _
ByVal As Integer, _
ByVal As Color _
) As GdPictureStatus
public GdPictureStatus SetRegionBorderColor(
int ,
Color
)
public function SetRegionBorderColor(
: Integer;
: Color
): GdPictureStatus;
public function SetRegionBorderColor(
: int,
: Color
) : GdPictureStatus;
public: GdPictureStatus SetRegionBorderColor(
int ,
Color
)
public:
GdPictureStatus SetRegionBorderColor(
int ,
Color
)
Parameters
- RegionID
- A unique region identifier of the specified region. You can obtain this identifier using the GdViewer.GetRegionID method or when creating regions using GdViewer.AddRegion or GdViewer.AddRegionInches methods.
- BorderColor
- A color object that defines the new border color of the specified region. You can obtain a suitable color using the GdViewer.ARGB 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.
Example
How to set the border color for all defined highlighted regions.
'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
For j As Integer = 1 To regCount
regID = GdViewer1.GetRegionID(j)
GdViewer1.SetRegionBorderWidth(regID, 4)
GdViewer1.SetRegionBorderColor(regID, GdViewer1.ARGB(0, 191, 255))
Next
'Redrawing regions with the newly defined color.
GdViewer1.Redraw()
Else
MessageBox.Show("No highlighted region found related to this document. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.SetRegionBorderColor")
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)
{
for (int j = 1; j <= regCount; j++)
{
regID = GdViewer1.GetRegionID(j);
GdViewer1.SetRegionBorderWidth(regID, 4);
GdViewer1.SetRegionBorderColor(regID, GdViewer1.ARGB(0, 191, 255));
}
//Redrawing regions with the newly defined color.
GdViewer1.Redraw();
}
else
MessageBox.Show("No highlighted region found related to this document. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.SetRegionBorderColor");
Example
How to set the border color for all defined highlighted regions.
'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
For j As Integer = 1 To regCount
regID = GdViewer1.GetRegionID(j)
GdViewer1.SetRegionBorderWidth(regID, 4)
GdViewer1.SetRegionBorderColor(regID, GdViewer1.ARGB(0, 191, 255))
Next
'Redrawing regions with the newly defined color.
GdViewer1.Redraw()
Else
MessageBox.Show("No highlighted region found related to this document. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.SetRegionBorderColor")
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)
{
for (int j = 1; j <= regCount; j++)
{
regID = GdViewer1.GetRegionID(j);
GdViewer1.SetRegionBorderWidth(regID, 4);
GdViewer1.SetRegionBorderColor(regID, GdViewer1.ARGB(0, 191, 255));
}
//Redrawing regions with the newly defined color.
GdViewer1.Redraw();
}
else
MessageBox.Show("No highlighted region found related to this document. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.SetRegionBorderColor");
See Also
Reference
GdViewer Class
GdViewer Members
Overload List
GetRegionBorderColor Method
GetRegionID Method
AddRegion(String,Int32,Int32,Int32,Int32,ForegroundMixMode,Int32) Method
AddRegionInches(String,Single,Single,Single,Single,ForegroundMixMode,Int32) Method
GetRegionBorderColor 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