Quartz2D指定显示范围
生活随笔
收集整理的這篇文章主要介紹了
Quartz2D指定显示范围
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
在qq中,可以看到頭像是圓形顯示的,通過CGContextClip可以設置
CGContextRef context=UIGraphicsGetCurrentContext();CGContextAddEllipseInRect(context, CGRectMake(100, 100, 100, 100));CGContextClip(context);UIImage *img=[UIImage imageNamed:@"img.jpg"];[img drawAtPoint:CGPointMake(100, 100)];?
CGContextRef context=UIGraphicsGetCurrentContext();UIImage *img=[UIImage imageNamed:@"img.jpg"];CGContextMoveToPoint(context, 30, 120);CGContextAddLineToPoint(context, 50, 200);CGContextAddLineToPoint(context, 200, 60);CGContextClosePath(context);CGContextClip(context);[img drawAtPoint:CGPointMake(30, 120)];?
轉載于:https://www.cnblogs.com/5ishare/p/4402282.html
總結
以上是生活随笔為你收集整理的Quartz2D指定显示范围的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 20151210小问题2
- 下一篇: 多线程 简洁版