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 BeforeRotation event is raised just before the rotation process starts and the Rotation event is raised right after the rotation process finishes.
Be aware that the page is only rotated in the control, not in the document itself. Files are always handled as read-only in the GdViewer control.
Syntax
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.
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 RotateFlipType = RotateFlipType.Rotate180FlipNone
If GdViewer1.Rotate(rotation) <> GdPictureStatus.OK Then
MessageBox.Show("The current page can't be rotated. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.Rotate")
End If
Else
MessageBox.Show("The file can't be loaded. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.Rotate")
End If
//We assume that the GdViewer1 control has been properly integrated.
if (GdViewer1.DisplayFromFile("") == GdPictureStatus.OK)
{
RotateFlipType rotation = RotateFlipType.Rotate180FlipNone;
if (GdViewer1.Rotate(rotation) != GdPictureStatus.OK)
MessageBox.Show("The current page can't be rotated. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.Rotate");
}
else
MessageBox.Show("The file can't be loaded. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.Rotate");
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 RotateFlipType = RotateFlipType.Rotate180FlipNone
If GdViewer1.Rotate(rotation) <> GdPictureStatus.OK Then
MessageBox.Show("The current page can't be rotated. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.Rotate")
End If
Else
MessageBox.Show("The file can't be loaded. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.Rotate")
End If
//We assume that the GdViewer1 control has been properly integrated.
if (GdViewer1.DisplayFromFile("") == GdPictureStatus.OK)
{
RotateFlipType rotation = RotateFlipType.Rotate180FlipNone;
if (GdViewer1.Rotate(rotation) != GdPictureStatus.OK)
MessageBox.Show("The current page can't be rotated. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.Rotate");
}
else
MessageBox.Show("The file can't be loaded. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.Rotate");
See Also