I want to rotate the Image based on the device orientation in Windows Phone 8 while taking the snap using PhotoCaptureDevice option.
When the Device orientation is
LandscapeLeft - Image to be rotated to -90
LandscapeRight - Image to be rotated to 90
But there is no option to find the device orientation in the Windows Phone 8 . Could you please anyone help me on this ?
You can use the acceleration sensor readings and then take the atan2 as follows:
angle = Math.Atan2(-x,y) * 180.0 / Math.PI;
where "angle" is the device orientation relativ to the default portrait orientation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With