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





In This Topic
RotatePage Method (GdViewer)
In This Topic
Rotates clockwise or flips the current page of the document displayed in the 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 page.

The BeforePageRotation event is raised just before the rotation process starts and the AfterPageRotation event is raised right after the rotation process finishes.

Syntax
'Declaration
 
Public Sub RotatePage( _
   ByVal Rotation As GdPictureRotateFlipType _
) 
public void RotatePage( 
   GdPictureRotateFlipType Rotation
)
public procedure RotatePage( 
    Rotation: GdPictureRotateFlipType
); 
public function RotatePage( 
   Rotation : GdPictureRotateFlipType
);
public: void RotatePage( 
   GdPictureRotateFlipType Rotation
) 
public:
void RotatePage( 
   GdPictureRotateFlipType Rotation
) 

Parameters

Rotation
A member of the GdPictureRotateFlipType enumeration. Defines the required rotation and flipping.
Remarks
You can regularly apply the GetStat method to determine if this method has been successful.
Example
How to rotate the current page upside down in the viewer.
'We assume that the GdViewer1 control has been properly integrated.
If GdViewer1.DisplayFromFile("") = GdPictureStatus.OK Then
    Dim rotation As GdPictureRotateFlipType = GdPictureRotateFlipType.Rotate180FlipNone
    GdViewer1.RotatePage(rotation)
    MessageBox.Show("The current page is rotated: " + GdViewer1.PageRotation.ToString(), "GdViewer.RotatePage")
Else
    MessageBox.Show("The file can't be loaded. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.RotatePage")
End If
//We assume that the GdViewer1 control has been properly integrated.
if (GdViewer1.DisplayFromFile("") == GdPictureStatus.OK)
{
    GdPictureRotateFlipType rotation = GdPictureRotateFlipType.GdPictureRotate180FlipNone;
    GdViewer1.RotatePage(rotation);
    MessageBox.Show("The current page is rotated: " + GdViewer1.PageRotation.ToString(), "GdViewer.RotatePage")
}
else
    MessageBox.Show("The file can't be loaded. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.RotatePage");
See Also