'Declaration
Public Sub CenterOnRect()
public void CenterOnRect()
public procedure CenterOnRect();
public function CenterOnRect();
public: void CenterOnRect();
public: void CenterOnRect();
'Declaration
Public Sub CenterOnRect()
public void CenterOnRect()
public procedure CenterOnRect();
public function CenterOnRect();
public: void CenterOnRect();
public: void CenterOnRect();
Just to inform you, that both the horizontal and the vertical scrollbars are set to new positions, if required.
Likewise to remind you, that the current page is determined by the CurrentPage property.
'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 Rect() = GdViewer1.GetSelectedTextRegions() If (GdViewer1.GetStat() = GdPictureStatus.OK) AndAlso (regions.Length > 0) Then Dim rect As Rect = regions(0) GdViewer1.SetRectCoordinatesOnDocumentInch(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.CenterOnRect") End If Else MessageBox.Show("The text can't be selected. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.CenterOnRect") 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(); Rect[] regions = GdViewer1.GetSelectedTextRegions(); if ((GdViewer1.GetStat() == GdPictureStatus.OK) && (regions.Length > 0)) { //The first region surely exists. Rect rect = regions[0]; GdViewer1.SetRectCoordinatesOnDocumentInch(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.CenterOnRect"); } else MessageBox.Show("The text can't be selected. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.CenterOnRect");