GdPicture.NET.14
GdPicture14 Namespace / GdViewer Class / ZoomMode Property
Example





In This Topic
ZoomMode Property (GdViewer)
In This Topic
Gets or sets the current zoom mode used by the GdViewer control and refreshes the control as well.

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

Syntax
'Declaration
 
Public Property ZoomMode As ViewerZoomMode
public ViewerZoomMode ZoomMode {get; set;}
public read-write property ZoomMode: ViewerZoomMode; 
public function get,set ZoomMode : ViewerZoomMode
public: __property ViewerZoomMode get_ZoomMode();
public: __property void set_ZoomMode( 
   ViewerZoomMode value
);
public:
property ViewerZoomMode ZoomMode {
   ViewerZoomMode get();
   void set (    ViewerZoomMode value);
}

Property Value

The default value is ViewerZoomMode.ZoomMode100.
Remarks
Be aware that the control is refreshed immediately when changing the ZoomMode property value.

You can also change this property using the SetZoom... methods.

Both the BeforeZoomChange and the AfterZoomChange events are raised when changing the property value.

Please try the Document Viewer Sample here to find out, how to utilize zooming features in your application.

Example
How to change the current zoom mode.
'We assume that the GdViewer1 control has been properly integrated.
            
'Determine the current zoom mode.
MessageBox.Show("The current zoom mode is " + GdViewer1.ZoomMode.ToString() + ".", "GdViewer.ZoomMode")
'Set the required zoom mode. The viewer will refresh.
GdViewer1.ZoomMode = ViewerZoomMode.ZoomModeFitToViewer
//We assume that the GdViewer1 control has been properly integrated.
            
//Determine the current zoom mode.
MessageBox.Show("The current zoom mode is " + GdViewer1.ZoomMode.ToString()+ ".", "GdViewer.ZoomMode");
//Set the required zoom mode. The viewer will refresh.
GdViewer1.ZoomMode = ViewerZoomMode.ZoomModeFitToViewer;
See Also