Change the orientation of the camera when taking pictures. Even if the orientation is locked.

I have an application that takes images. I want the image orientation of the camera to change when the device is rotated, so that the image looks in the correct orientation, as was customary. I want this to work even when the device orientation is locked. What is the best way to do this? Accelerometer / Core Motion? Advice and guidance are greatly appreciated.

+6
source share
2 answers

Just an initial thought, did you consider the rotation of the image after taking it? I'm not sure if this is the right solution for you, as the display will still be oriented sideways when shooting. this will surely get around the screen lock problem.

Hope this helps. Kiran

-1
source

There seems to be no way around CoreMotion. Reading x / g accelerometer data is enough to determine the orientation. This blog post gives a good introduction: http://nshipster.com/cmdevicemotion/

0
source

Source: https://habr.com/ru/post/978014/


All Articles