Beispiel #1
0
 /// <summary>
 /// Retrieves the JPEG orientation from the specified screen rotation
 /// </summary>
 /// <param name="rotation"></param>
 /// <returns></returns>
 private int GetOrientation(int rotation)
 {
     // Sensor orientation is 90 for most devices, or 270 for some devices (eg. Nexus 5X)
     // We have to take that into account and rotate JPEG properly.
     // For devices with orientation of 90, we simply return our mapping from ORIENTATIONS.
     // For devices with orientation of 270, we need to rotate the JPEG 180 degrees.
     return((Orientations.Get(rotation) + mSensorOrientation + 270) % 360);
 }