ZoomDocumentArea(Double,Double,Double,Double) Method
Adjusts the current zoom to the area covered by the specified rectangle on the current page of the document displayed in the viewer.
The viewer control is subsequently refreshed to zoom on the defined area.
public GdPictureStatus ZoomDocumentArea(
double ,
double ,
double ,
double
)
public function ZoomDocumentArea(
: Double;
: Double;
: Double;
: Double
): GdPictureStatus;
public function ZoomDocumentArea(
: double,
: double,
: double,
: double
) : GdPictureStatus;
public: GdPictureStatus ZoomDocumentArea(
double ,
double ,
double ,
double
)
public:
GdPictureStatus ZoomDocumentArea(
double ,
double ,
double ,
double
)
'Declaration
Public Function ZoomDocumentArea( _
ByVal As Double, _
ByVal As Double, _
ByVal As Double, _
ByVal As Double _
) As GdPictureStatus
Parameters
- Left
- The horizontal (left) coordinate of the top-left corner of the required area on the displayed page, in pixels. The origin is set to the top-left corner of the displayed page.
- Top
- The vertical (top) coordinate of the top-left corner of the required area on the displayed page, in pixels. The origin is set to the top-left corner of the displayed page.
- Width
- The width of the required area, in pixels.
- Height
- The height of the required area, in pixels.
Return Value
A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK.
We strongly recommend always checking this status first.
How to zoom on the specified document area.
'We assume that the GdViewer1 control has been properly integrated.
Private Sub GdViewer1_MouseClick(ByVal sender As Object, ByVal e As MouseEventArgs)
Dim left As Double = e.GetPosition(Me).X
Dim top As Double = e.GetPosition(Me).Y
Dim width As Double = 400, height As Double = 200
GdViewer1.ZoomDocumentArea(left - width / 2, top - height / 2, width, height)
End Sub
//We assume that the GdViewer1 control has been properly integrated.
void GdViewer1_MouseClick(object sender, MouseEventArgs e)
{
double left = e.GetPosition(this).X;
double top = e.GetPosition(this).Y;
double width = 400, height = 200;
GdViewer1.ZoomDocumentArea(left - width / 2, top - height / 2, width, height);
}