Example





In This Topic
GdPicture14.WPF Namespace / GdViewer Class / ViewRotation Property

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 GdPictureRotateFlipType
public GdPictureRotateFlipType ViewRotation {get; set;}
public read-write property ViewRotation: GdPictureRotateFlipType; 
public function get,set ViewRotation : GdPictureRotateFlipType
public: __property GdPictureRotateFlipType get_ViewRotation();
public: __property void set_ViewRotation( 
   GdPictureRotateFlipType value
);
public:
property GdPictureRotateFlipType ViewRotation {
   GdPictureRotateFlipType get();
   void set (    GdPictureRotateFlipType value);
}

Property Value

A member of the GdPictureRotateFlipType enumeration. The default value is GdPictureRotateFlipType.GdPictureRotateNoneFlipNone.
Remarks
To only rotate a single page, you can use the RotatePage 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 GdPictureRotateFlipType = GdPictureRotateFlipType.Rotate180FlipNone
    GdViewer1.RotateView(rotation)
    MessageBox.Show("The current view is rotated: " + GdViewer1.ViewRotation.ToString(), "GdViewer.ViewRotation")
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)
{
    GdPictureRotateFlipType rotation = GdPictureRotateFlipType.GdPictureRotate180FlipNone;
    GdViewer1.RotateView(rotation);
    MessageBox.Show("The current view is rotated: " + GdViewer1.ViewRotation.ToString(), "GdViewer.ViewRotation")
}
else
    MessageBox.Show("The file can't be loaded. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.ViewRotation");
See Also