假设我有一个 UIImage。 我需要旋转然后在全局坐标系(不是 UIImage 坐标系)中裁剪它。因此生成的图像将被裁剪和旋转。
我该怎么做? CGImageCreateWithImageInRect 将仅在图像相对坐标中裁剪图像。
PS 在评论中回答。你应该使用 CIImage。
最佳答案
也许这可以帮助
//init
CIImage *image = [CIImage imageWithCGImage:CGImageRef];
//rotation
CIImage *rotatedImage = [image imageByApplyingTransform:someTransform];
//crop
CIImage *croppedImage = [rotatedImage imageByCroppingToRect:someRect];
关于ios - 旋转和裁剪 UIImage,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25822730/