GdPicture.NET.14
GdPicture14 Namespace / GdViewer Class / RotateView Method
A member of the RotateFlipType enumeration. Defines the required rotation and flipping.
Example





In This Topic
RotateView Method (GdViewer)
In This Topic
Rotates clockwise or flips the global view of this GdViewer control. The rotation angle can be set to 0, 90, 180 or 270 degrees clockwise and you are allowed to specify the axis used to flip the view.

The BeforeRotation event is raised just before the rotation process starts and the Rotation event is raised right after the rotation process finishes.

Syntax
'Declaration
 
Public Function RotateView( _
   ByVal Rotation As RotateFlipType _
) As GdPictureStatus
public GdPictureStatus RotateView( 
   RotateFlipType Rotation
)
public function RotateView( 
    Rotation: RotateFlipType
): GdPictureStatus; 
public function RotateView( 
   Rotation : RotateFlipType
) : GdPictureStatus;
public: GdPictureStatus RotateView( 
   RotateFlipType Rotation
) 
public:
GdPictureStatus RotateView( 
   RotateFlipType Rotation
) 

Parameters

Rotation
A member of the RotateFlipType enumeration. Defines the required rotation and flipping.

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
The BeforeRotation event is raised just before the rotation occurs and the Rotation event is raised right after the rotation finishes.

If you want to rotate the current page, please use the Rotate method instead. Likewise, be aware that displayed documents, specifically images, are always handled as read-only in the GdViewer control.

Example
How to rotate the viewer's global view upside down.
'We assume that the GdViewer1 control has been properly integrated.
If GdViewer1.DisplayFromFile("") = GdPictureStatus.OK Then
    Dim rotation As RotateFlipType = RotateFlipType.Rotate180FlipNone
    If GdViewer1.RotateView(rotation) <> GdPictureStatus.OK Then
        MessageBox.Show("The view can't be rotated. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.RotateView")
    End If
Else
    MessageBox.Show("The file can't be loaded. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.RotateView")
End If
//We assume that the GdViewer1 control has been properly integrated.
if (GdViewer1.DisplayFromFile("") == GdPictureStatus.OK)
{
    RotateFlipType rotation = RotateFlipType.Rotate180FlipNone;
    if (GdViewer1.RotateView(rotation) != GdPictureStatus.OK)
        MessageBox.Show("The view can't be rotated. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.RotateView");
}
else
    MessageBox.Show("The file can't be loaded. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.RotateView");
See Also