Front facing camera in UIImagePickerController

后端 未结 9 1231
暗喜
暗喜 2020-12-02 06:42

I am developing the front facing camera app in iPad2 by using the UIImagePickerController.

When I capture the image it\'s shows as flipped from left to

9条回答
  •  执笔经年
    2020-12-02 07:27

    As the other answers, I had the same problem. As Yonatan Betzer mentioned, just flip the final image is only half the answer, because the preview image, displayed by the UIPickerController when you take a picture with the front camera, it's still inverted (mirrored).

    Yonatan Betzer's anwser works great, but he did not mentioned how or where to put the action to change the camera device.

    Based in some codes from internet, I created a Pod to get this wanted behavior:

    https://github.com/lucasecf/LEMirroredImagePicker

    After installed, you just have to call this two lines of code together with your UIImagePickerController:

    self.mirrorFrontPicker = [[LEMirroredImagePicker alloc] initWithImagePicker:pickerController];
    [self.mirrorFrontPicker mirrorFrontCamera];
    

    And thats it, simply as that. You can check for more informations in the README of the github link.

提交回复
热议问题