且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用CGContext裁剪UIImage的问题?

更新时间:2023-11-09 23:18:10

您创建的用于绘制图像的上下文与原始图像具有相同的大小。这就是为什么它们具有相同的尺寸。

The context you create to draw the image has the same size that the original image. That's why they have the same size.

如果您不想重新发明***,请查看 TouchCode 项目。您将找到完成此任务的UIImage类别(请参阅 UIImage_ThumbnailExtensions.m )。

If you don't want to re-invent the wheel, take a look at the TouchCode project on Google Code. You will find UIImage categories that do the job (see UIImage_ThumbnailExtensions.m).