Quartz2D简单绘制之不规则形状
生活随笔
收集整理的這篇文章主要介紹了
Quartz2D简单绘制之不规则形状
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
?
// 畫(huà)不規(guī)則形狀CGContextRef contextRef = UIGraphicsGetCurrentContext();
CGContextSetRGBStrokeColor(contextRef, 1.0f, 1.0f, 1.0f, 1); // 填充時(shí)用不到
CGContextSetLineWidth(contextRef, 2.0f); // 填充時(shí)用不到
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); // 不填充
轉(zhuǎn)載于:https://www.cnblogs.com/pengyingh/articles/2388405.html
總結(jié)
以上是生活随笔為你收集整理的Quartz2D简单绘制之不规则形状的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: link time code gener
- 下一篇: 认识flex中的sprite