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
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 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");
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