【发布时间】:2013-04-05 14:44:50
【问题描述】:
在开发基于摄影的应用时,我需要旋转图像。但是在旋转图像后,它的边界会变得模糊。我附上了这个截图..
如您所见,第一张图片看起来不错,但其他旋转后的图片看起来不太好。
这是我的代码.....
[img setBackgroundColor:[UIColor blackColor]];
[img setContentMode:UIViewContentModeScaleAspectFit];
[img.layer setBorderColor:[[UIColor whiteColor]CGColor]];
[img.layer setBorderWidth:3.0];
[img setTransform:CGAffineTransformMakeRotation(rotation*3.14/180)];
我用过这个解决方案...
CGContextRotateCTM(context, radians);
[sourceImage drawInRect:rect];
但是当图像有边界时如何使用此代码。
请给出您的宝贵意见.....
【问题讨论】:
标签: iphone ios uiimageview cgcontext cgaffinetransform