[英]Setting CGContextSetStrokeColorWithColor with a UIColor that was passed as a parameter
[英]What's the difference between CGContextSetStrokeColorWithColor UIColor setStroke?
这两种设置笔触颜色的方式之间有什么区别吗?
CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor)
[[UIColor redColor] setStroke]
例
CGContextRef cr = UIGraphicsGetCurrentContext();
CGContextSetStrokeColorWithColor(cr, [UIColor redColor].CGColor);
[[UIColor redColor] setStroke];
UIBezierPath *bp = [UIBezierPath new];
[bp stroke];
UIGraphicsEndImageContext();
一个是较长的纯C语言,另一个则较短,并且使用Objective-C。 它们具有相同的效果。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.