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.
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.
The width of the required area, in pixels.
The height of the required area, in pixels.
Example





In This Topic
GdPicture14.WPF Namespace / GdViewer Class / ZoomDocumentArea(Double,Double,Double,Double) Method

ZoomDocumentArea(Double,Double,Double,Double) Method

In This Topic
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.
Syntax
'Declaration
 
Public Function ZoomDocumentArea( _
   ByVal Left As Double, _
   ByVal Top As Double, _
   ByVal Width As Double, _
   ByVal Height As Double _
) As GdPictureStatus
public GdPictureStatus ZoomDocumentArea( 
   double Left,
   double Top,
   double Width,
   double Height
)
public function ZoomDocumentArea( 
    Left: Double;
    Top: Double;
    Width: Double;
    Height: Double
): GdPictureStatus; 
public function ZoomDocumentArea( 
   Left : double,
   Top : double,
   Width : double,
   Height : double
) : GdPictureStatus;
public: GdPictureStatus ZoomDocumentArea( 
   double Left,
   double Top,
   double Width,
   double Height
) 
public:
GdPictureStatus ZoomDocumentArea( 
   double Left,
   double Top,
   double Width,
   double Height
) 

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.
Remarks
Please note that the ZoomMode property is set to ViewerZoomMode.ZoomModeCustom using this method.

The ZoomChanged event, respectively the PreviewZoomChanged event, is raised using this method.

Example
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);
}
See Also