GdPicture.NET.14
GdPicture14 Namespace / GdViewer Class / ViewRotation Property
Example





In This Topic
ViewRotation Property (GdViewer)
In This Topic
Gets or sets the current rotation and flipping of the page view in the GdViewer control.

This property specifies how the view is rotated and flipped in the GdViewer control when displaying the page.

Syntax
'Declaration
 
Public Property ViewRotation As RotateFlipType
public RotateFlipType ViewRotation {get; set;}
public read-write property ViewRotation: RotateFlipType; 
public function get,set ViewRotation : RotateFlipType
public: __property RotateFlipType get_ViewRotation();
public: __property void set_ViewRotation( 
   RotateFlipType value
);
public:
property RotateFlipType ViewRotation {
   RotateFlipType get();
   void set (    RotateFlipType value);
}

Property Value

A member of the System.Drawing.RotateFlipType enumeration. The default value is System.Drawing.RotateFlipType.RotateNoneFlipNone.
Remarks
To only rotate a single page, you can use the Rotate method. To rotate the curent view, you can use the RotateView method.
Example
How to rotate the viewer's global view upside down and find out the final view rotation value.
'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 is rotated: " + GdViewer1.ViewRotation.ToString(), "GdViewer.ViewRotation");
    Else
        MessageBox.Show("The view can't be rotated. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.ViewRotation")
    End If
Else
    MessageBox.Show("The file can't be loaded. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.ViewRotation")
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 is rotated: " + GdViewer1.ViewRotation.ToString(), "GdViewer.ViewRotation");
    else
        MessageBox.Show("The view can't be rotated. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.ViewRotation");
}
else
    MessageBox.Show("The file can't be loaded. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.ViewRotation");
See Also