How can I flip iphone front camera
I'm make an app that needs to show camera image in realtime. For the front camera I want to flip it horizontally so it's not 'mirrored'. I found the following code online. It works well with the rear camera. But when I switch to the front camera, the same code give me a picture like flipped开发者_开发知识库 but also rotated with -90 degrees. I tried to rotate back but it doesn't seem to work.
CATransform3D perspective = CATransform3DScale(CATransform3DIdentity, 1.0, -1.0, 0);
[[self previewLayer] setTransform:perspective];
[[self previewLayer] setTransform:CATransform3DMakeRotation(M_PI, 0.0f, 1.0f, 0.0f)];
精彩评论