'Declaration
Public Function IsRect() As Boolean
public bool IsRect()
public function IsRect(): Boolean;
public function IsRect() : boolean;
public: bool IsRect();
public: bool IsRect();
The rectangle of area selection is determined using both SearchText(String,Int32,Boolean) and SearchText(String,Int32,Boolean,Boolean) methods, when setting the Occurrence parameter higher than 0. Hovewer, you can also define the custom rectangle of selection using one of these methods: SetRectCoordinatesOnDocument , SetRectCoordinatesOnDocumentInches and SetRectCoordinatesOnViewer.
You can use the CenterOnRect method to make the rectangle visible, if any is defined, or the ClearRect method to clear the rectangle's location point and dimensions.
'Declaration
Public Function IsRect() As Boolean
public bool IsRect()
public function IsRect(): Boolean;
public function IsRect() : boolean;
public: bool IsRect();
public: bool IsRect();
'We assume that the GdViewer1 control has been properly integrated 'and your document has been properly displayed as well. If GdViewer1.SelectAllText() = GdPictureStatus.OK Then If GdViewer1.IsRect() Then GdViewer1.ClearRect() Dim regions As RectangleF() = GdViewer1.GetSelectedTextRegions() If (GdViewer1.GetStat() = GdPictureStatus.OK) AndAlso (regions.Count() > 0) Then 'The first region surely exists. Dim rect As RectangleF = regions.ElementAt(0) GdViewer1.SetRectCoordinatesOnDocumentInches(rect.Left, rect.Top, rect.Width, rect.Height) GdViewer1.CenterOnRect() Else MessageBox.Show("The text region can't be found. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.IsRect") End If Else MessageBox.Show("The text can't be selected. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.IsRect") End If
//We assume that the GdViewer1 control has been properly integrated //and your document has been properly displayed as well. if (GdViewer1.SelectAllText() == GdPictureStatus.OK) { if (GdViewer1.IsRect()) GdViewer1.ClearRect(); RectangleF[] regions = GdViewer1.GetSelectedTextRegions(); if ((GdViewer1.GetStat() == GdPictureStatus.OK) && (regions.Count() > 0)) { //The first region surely exists. RectangleF rect = regions.ElementAt(0); GdViewer1.SetRectCoordinatesOnDocumentInches(rect.Left, rect.Top, rect.Width, rect.Height); GdViewer1.CenterOnRect(); } else MessageBox.Show("The text region can't be found. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.IsRect"); } else MessageBox.Show("The text can't be selected. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.IsRect");
GdViewer Class
GdViewer Members
ClearRect Method
CenterOnRect Method
RectBorderColor Property
RectBorderSize Property
SetRectBorderColor Method
SelectAllText Method
SearchText(String,Int32,Boolean) Method
SearchText(String,Int32,Boolean,Boolean) Method
SearchText(String,Int32,Boolean,Boolean,Boolean) Method
SetRectCoordinatesOnDocument Method
SetRectCoordinatesOnDocumentInches Method
SetRectCoordinatesOnViewer Method