如何从UIImagePicker相机拍摄后裁剪图像? [英] How to crop image after taken from UIImagePicker Camera?

查看:201
本文介绍了如何从UIImagePicker相机拍摄后裁剪图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让用户拍摄16x9宽高比图像看起来像是高清照片。我正在使用cameraViewOverlay覆盖两端的黑条,但是拍摄图像时,如何在不调整图像比例或更改图像比例的情况下裁剪顶部和底部?

I'm trying to allow the user to take 16x9 aspect ratio images to look like they are nice HD photos. I'm using the cameraViewOverlay to overlay black bars on both ends, but when the image is taken, how do I crop the top and bottom without resizing or changing the scale of the image?

谢谢。

推荐答案

关于如何缩放/裁剪从相机回来的UIImage,有各种各样的帖子,例如这一个

There are various posts around on how to scale/crop a UIImage you get back from the camera, like this one.

它比你想象的要复杂一点,因为相机图像是旋转的,所以你必须考虑旋转,即使你只是裁剪。

It's a little trickier than you'd expect, because camera images are rotated, so you have to think about rotations even if you're just cropping.

这篇关于如何从UIImagePicker相机拍摄后裁剪图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆