'Declaration
Public Function RegionCount() As Integer
public int RegionCount()
public function RegionCount(): Integer;
public function RegionCount() : int;
public: int RegionCount();
public: int RegionCount();
You can define a highlighted region using AddRegion(String,Int32,Int32,Int32,Int32,ForegroundMixMode,Int32) or AddRegionInches(String,Single,Single,Single,Single,ForegroundMixMode,Int32) methods. Be aware that highlighted regions are also determined using both SearchText(String,Int32,Boolean) and SearchText(String,Int32,Boolean,Boolean) methods.
'Declaration
Public Function RegionCount() As Integer
public int RegionCount()
public function RegionCount(): Integer;
public function RegionCount() : int;
public: int RegionCount();
public: int RegionCount();
Just to inform you, that you are allowed to completely remove all defined highlighted regions using the RemoveAllRegions method
'We assume that the GdViewer1 control has been properly integrated. If GdViewer1.DisplayFromFile("") = GdPictureStatus.OK Then Dim text_to_find As String = "GdPicture" GdViewer1.RemoveAllRegions() Dim text_found As Boolean = GdViewer1.SearchText(text_to_find, 0, True, True) If GdViewer1.GetStat() = GdPictureStatus.OK Then If text_found Then GdViewer1.Redraw() MessageBox.Show("The number of highlighted regions: " + GdViewer1.RegionCount().ToString(), "GdViewer.RegionCount") Else MessageBox.Show("The given text has not been found.", "GdViewer.RegionCount") End If Else MessageBox.Show("The search process has failed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.RegionCount") End If Else MessageBox.Show("The file can't be displayed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.RegionCount") End If
//We assume that the GdViewer1 control has been properly integrated. if (GdViewer1.DisplayFromFile("") == GdPictureStatus.OK) { string text_to_find = "GdPicture"; GdViewer1.RemoveAllRegions(); bool text_found = GdViewer1.SearchText(text_to_find, 0, true, true); if (GdViewer1.GetStat() == GdPictureStatus.OK) { if (text_found) { GdViewer1.Redraw(); MessageBox.Show("The number of highlighted regions: " + GdViewer1.RegionCount().ToString(), "GdViewer.RegionCount"); } else MessageBox.Show("The given text has not been found.", "GdViewer.RegionCount"); } else MessageBox.Show("The search process has failed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.RegionCount"); } else MessageBox.Show("The file can't be displayed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.RegionCount");
GdViewer Class
GdViewer Members
RemoveAllRegions Method
AddRegion(String,Int32,Int32,Int32,Int32,ForegroundMixMode,Int32) Method
AddRegionInches(String,Single,Single,Single,Single,ForegroundMixMode,Int32) Method
SearchText(String,Int32,Boolean,Boolean,Boolean) Method
SearchText(Int32,String,Int32,Boolean,Boolean,Boolean,Single,Single,Single,Single) Method