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





In This Topic
SetZoomShrinkWidthViewer Method (GdViewer)
In This Topic
Shrinks the document currently displayed in the GdViewer control to the current width of the viewer area.

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

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

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