GdPicture.NET.14
GdPicture14 Namespace / GdViewer Class / SetZoomWidthViewer Method
Example





In This Topic
SetZoomWidthViewer Method (GdViewer)
In This Topic
Fits the document currently displayed in the GdViewer control to the current width of the viewer area, in other words the document is zoomed to fit the viewer's width.

This method sets the ZoomMode property to ViewerZoomMode.ZoomModeWidthViewer and refreshes the control as well.

Syntax
'Declaration
 
Public Function SetZoomWidthViewer() As GdPictureStatus
public GdPictureStatus SetZoomWidthViewer()
public function SetZoomWidthViewer(): GdPictureStatus; 
public function SetZoomWidthViewer() : GdPictureStatus;
public: GdPictureStatus SetZoomWidthViewer(); 
public:
GdPictureStatus SetZoomWidthViewer(); 

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
Just to inform you that if the ZoomMode property already has a value equal to ViewerZoomMode.ZoomModeWidthViewer, this method does nothing.

Both the BeforeZoomChange and the AfterZoomChange events are raised using this method.

You can also 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.SetZoomWidthViewer")
            
'Set the required zoom mode. The viewer will refresh.
GdViewer1.SetZoomWidthViewer()
'It is the same as assigning GdViewer1.ZoomMode = ViewerZoomMode.ZoomModeWidthViewer
//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.SetZoomWidthViewer");
            
//Set the required zoom mode. The viewer will refresh.
GdViewer1.SetZoomWidthViewer();
//It is the same as assigning GdViewer1.ZoomMode = ViewerZoomMode.ZoomModeWidthViewer;
See Also