Quartz2D简单绘制之不规则形状
生活随笔
收集整理的這篇文章主要介紹了
Quartz2D简单绘制之不规则形状
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?
// 畫不規則形狀CGContextRef contextRef = UIGraphicsGetCurrentContext();
CGContextSetRGBStrokeColor(contextRef, 1.0f, 1.0f, 1.0f, 1); // 填充時用不到
CGContextSetLineWidth(contextRef, 2.0f); // 填充時用不到
CGFloat components[] = { 1.0f, 0.0f, 0.0f, 1.0f};
CGContextSetFillColor(contextRef, components);
CGContextMoveToPoint(contextRef, 150.0f, 150.0f);
CGContextAddLineToPoint(contextRef, 200.0f, 170.0f);
CGContextAddLineToPoint(contextRef, 180.0f, 300.0f);
CGContextAddLineToPoint(contextRef, 80.0f, 300.0f);
CGContextClosePath(contextRef);
//CGContextFillPath(contextRef); // 填充
CGContextStrokePath(contextRef); // 不填充
轉載于:https://www.cnblogs.com/pengyingh/articles/2388405.html
總結
以上是生活随笔為你收集整理的Quartz2D简单绘制之不规则形状的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: link time code gener
- 下一篇: 认识flex中的sprite