您的位置:首页 > 其它

CoreGraphics --- 翻转坐标系

2015-12-29 17:24 405 查看
1. 由于CoreGraphics 的坐标系与手机屏幕坐标系的Y轴是相反的, 所以在我们开发的时候, 需要翻转坐标系;

- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextTranslateCTM(context, 0, self.height);
CGContextTranslateCTM(context, 1.0f, -1.0f);
[self.viewToMagnify.layer renderInContext:context];
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: