Convert Clockwise Degrees To Simple Orientation - CSharp Windows.Devices.Sensors

CSharp examples for Windows.Devices.Sensors:SimpleOrientation

Description

Convert Clockwise Degrees To Simple Orientation

Demo Code


using Windows.Storage.FileProperties;
using Windows.Media.Capture;
using Windows.Graphics.Display;
using Windows.Devices.Sensors;
using Windows.Devices.Enumeration;
using System;/*from w  ww  .  ja  v a2 s.  co  m*/

public class Main{
        private static SimpleOrientation ConvertClockwiseDegreesToSimpleOrientation(int orientation)
        {
            switch (orientation)
            {
                case 270:
                    return SimpleOrientation.Rotated90DegreesCounterclockwise;
                case 180:
                    return SimpleOrientation.Rotated180DegreesCounterclockwise;
                case 90:
                    return SimpleOrientation.Rotated270DegreesCounterclockwise;
                case 0:
                default:
                    return SimpleOrientation.NotRotated;
            }
        }
}

Related Tutorials