Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我从 中拍摄了一张图像UIImagePickerController,但文件看起来太大而无法通过互联网传输,我想调整图像大小。我找不到与图像处理相关的任何方法。
UIImagePickerController
有什么推荐吗?
您可以使用创建所需大小的上下文UIGraphicsBeginImageContext(),然后使用 UIImage 的方法将图像绘制到上下文-drawInRect:,最后使用UIGraphicsGetImageFromCurrentImageContext()拉出新的 UIImage。
UIGraphicsBeginImageContext()
-drawInRect:
UIGraphicsGetImageFromCurrentImageContext()
我试图在两行中获取按钮文本,请参见小提琴:http: //jsfiddle.net/gaurav360/Yxqx2/
它在除Opera之外的所有浏览器中运行良好...
提前致谢。