Reference Guide
GdPicture14.WPF Namespace / GdViewer Class / Zoom Property
Example





In This Topic
    Zoom Property (GdViewer)
    In This Topic
    Gets or sets the current zoom (magnification) factor, that is applied during the following page rendering operations in the GdViewer control. Please use the value 1 to define the 100% zoom factor, 1.5 to define 150%, 2 to define the 200% zoom factor, etc.

    If the newly specified Zoom value is the same as the current Zoom value, this method does nothing.

    Syntax
    'Declaration
     
    
    Public Property Zoom As Double
    public double Zoom {get; set;}
    public read-write property Zoom: Double; 
    public function get,set Zoom : double
    public: __property double get_Zoom();
    public: __property void set_Zoom( 
       double value
    );
    public:
    property double Zoom {
       double get();
       void set (    double value);
    }

    Property Value

    The default value is 1.
    Remarks
    Please note that the ZoomMode property is set to ViewerZoomMode.ZoomModeCustom when changing the Zoom property value. The control is subsequently refreshed as well.

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

    Please try the Document Viewer Sample in your [INSTALLATION FOLDER]/Samples/WPF folder to find out, how to utilize zooming features in your application.

    Example
    How to change the current zoom factor.
    'We assume that the GdViewer1 control has been properly integrated.
                
    'Determine the current zoom.
    Dim z As Short = (Math.Round(GdViewer1.Zoom * 100))
    MessageBox.Show("The current zoom is " + z.ToString() + "%.", "GdViewer.Zoom")
    'Set the current zoom to 150%. The viewer will refresh.
    GdViewer1.Zoom = 1.5
    //We assume that the GdViewer1 control has been properly integrated.
                
    //Determine the current zoom.
    short z = (short)(Math.Round(GdViewer1.Zoom * 100));
    MessageBox.Show("The current zoom is " + z.ToString() + "%.", "GdViewer.Zoom");
    //Set the current zoom to 150%. The viewer will refresh.
    GdViewer1.Zoom = 1.5;
    See Also