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]; }
相关文章推荐
- Ios - 计算Label文字中字体的frame - 实用代码
- Access restriction:The type JPEGCodec is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\rt.jar
- libevent 编译 Windows
- Educational Codeforces Round 3 B. The Best Gift
- 在Android的webview中定制js的alert,confirm和prompt对话框的方法
- Cron表达式
- js 实现ReplaceAll 的方法
- 识别二维码图片
- 阿里云 linux rsync 数据同步亲自配置成功过,现在已经运行中
- 奥普拉·温弗瑞 哈佛大学2013毕业典礼演讲
- Markdown写作浅谈
- Linux进程信号
- 用SQL语句创建存储过程,并执行
- IOS之同步请求、异步请求、GET请求、POST请求
- mycat中文乱码-解决方案
- Android上gdb+gdbserver调试初体验
- Linux策略路由使用场景及验证
- 数据库第二章理论总结
- gcc在x64体系中如何传递参数,linux,mac,iOS适用
- top 使用技巧