'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 firstRegColor As Color = GdViewer1.GetRegionColor(GdViewer1.GetRegionID(0))
Dim currColor As Color, newColor As Color = Color.FromArgb(255, 65, 190, 190)
For j As Integer = 0 To regCount-1
regID = GdViewer1.GetRegionID(j)
currColor = GdViewer1.GetRegionColor(regID)
If currColor = firstRegColor Then GdViewer1.SetRegionColor(regID, newColor)
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.GetRegionColor")
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)
{
Color firstRegColor = GdViewer1.GetRegionColor(GdViewer1.GetRegionID(0));
Color currColor, newColor = Color.FromArgb(255, 65, 190, 190);
for (int j = 0; j < regCount; j++)
{
regID = GdViewer1.GetRegionID(j);
currColor = GdViewer1.GetRegionColor(regID);
if (currColor == firstRegColor)
GdViewer1.SetRegionColor(regID, newColor);
}
//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.GetRegionColor");