'We assume that the GdViewer1 control has been properly integrated.
If GdViewer1.DisplayFromFile("") = GdPictureStatus.OK Then
Dim text_to_find As String = "GdPicture"
Dim occurrence As Integer = 1
Dim left As Single = 0, top As Single = 0, width As Single = 0, height As Single = 0
Dim text_found As Boolean = False
GdViewer1.RemoveAllRegions()
While GdViewer1.SearchText(GdViewer1.CurrentPage, text_to_find, occurrence, True, True, left, top, width, height)
text_found = True
GdViewer1.AddRegionInches("Region" + occurrence.ToString(), left, top, width, height, ForegroundMixMode.ForegroundMixModeMASKPEN, GdViewer1.ARGB(255, 176, 224, 230))
occurrence = occurrence + 1
End While
If text_found Then
GdViewer1.Redraw()
MessageBox.Show("The number of highlighted regions: " + GdViewer1.RegionCount().ToString(), "GdViewer.RemoveAllRegions")
Else
MessageBox.Show("The given text has not been found.", "GdViewer.RemoveAllRegions")
End If
Else
MessageBox.Show("The file can't be displayed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.RemoveAllRegions")
End If
//We assume that the GdViewer1 control has been properly integrated.
if (GdViewer1.DisplayFromFile("") == GdPictureStatus.OK)
{
string text_to_find = "GdPicture";
int occurrence = 1;
float left = 0, top = 0, width = 0, height = 0;
bool text_found = false;
GdViewer1.RemoveAllRegions();
while (GdViewer1.SearchText(GdViewer1.CurrentPage, text_to_find, occurrence, true, true, ref left, ref top, ref width, ref height))
{
text_found = true;
GdViewer1.AddRegionInches("Region" + occurrence.ToString(), left, top, width, height, ForegroundMixMode.ForegroundMixModeMASKPEN, GdViewer1.ARGB(255, 176, 224, 230));
occurrence = occurrence + 1;
}
if (text_found)
{
GdViewer1.Redraw();
MessageBox.Show("The number of highlighted regions: " + GdViewer1.RegionCount().ToString(), "GdViewer.RemoveAllRegions");
}
else
MessageBox.Show("The given text has not been found.", "GdViewer.RemoveAllRegions");
}
else
MessageBox.Show("The file can't be displayed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.RemoveAllRegions");