iPhone4使用前置摄像头拍照

发布于 2024-12-08 08:56:06 字数 594 浏览 0 评论 0原文

我想用 iPhone4 的前置摄像头拍照。 我的问题是拍摄后的照片是镜像的。 所以我想在预览上应用镜像变换,以便以与预览相同的方式呈现镜头。

这是我使用的代码,但它不起作用,转换不镜像,它只是旋转图片,我不明白为什么会发生这种情况。

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType=UIImagePickerControllerSourceTypeCamera;
imagePicker.cameraDevice=UIImagePickerControllerCameraDeviceFront;
imagePicker.cameraViewTransform=CGAffineTransformScale(CGAffineTransformIdentity, -1,1)
[self presentModalViewController:imagePicker animated:YES];
[imagePicker release];

怎么了?

感谢大家。

I want to take a picture from the front camera from an iPhone4.
My problem is that the taken picture is mirrored after the shot.
So I thought to apply a mirror transformation on the preview in order to present the shot in the same way as the preview is.

This is the code that I use, but it doesn't work, the transformation don't mirror, it just rotate the picture, and I don't understand why it happens.

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType=UIImagePickerControllerSourceTypeCamera;
imagePicker.cameraDevice=UIImagePickerControllerCameraDeviceFront;
imagePicker.cameraViewTransform=CGAffineTransformScale(CGAffineTransformIdentity, -1,1)
[self presentModalViewController:imagePicker animated:YES];
[imagePicker release];

What's wrong?

Thanks to all.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文