[英]What's the difference between CGContextSetStrokeColorWithColor UIColor setStroke?
Is there any difference between those two ways of setting stroke color? 这两种设置笔触颜色的方式之间有什么区别吗?
CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor)
[[UIColor redColor] setStroke]
Example 例
CGContextRef cr = UIGraphicsGetCurrentContext();
CGContextSetStrokeColorWithColor(cr, [UIColor redColor].CGColor);
[[UIColor redColor] setStroke];
UIBezierPath *bp = [UIBezierPath new];
[bp stroke];
UIGraphicsEndImageContext();
One is longer and pure C. The other is shorter and uses Objective-C. 一个是较长的纯C语言,另一个则较短,并且使用Objective-C。 They have the same effect.
它们具有相同的效果。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.