Ios 设置笔画颜色
我正在创建一个绘图应用程序,我想集成,但问题是当用户在我的Ios 设置笔画颜色,ios,rgb,uicolor,picker,stroke,Ios,Rgb,Uicolor,Picker,Stroke,我正在创建一个绘图应用程序,我想集成,但问题是当用户在我的UIView上绘图时,我想使用选择器中的UIColor作为笔划颜色 如果CGContextSetRGBStrokeColor是用RGB值编码的,而不是UIColor,我该如何做 我目前有: CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), red, green, blue, 1); 任何帮助都将不胜感激。使用: UIColor *color = ... // your s
UIView
上绘图时,我想使用选择器中的UIColor
作为笔划颜色
如果CGContextSetRGBStrokeColor
是用RGB值编码的,而不是UIColor
,我该如何做
我目前有:
CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), red, green, blue, 1);
任何帮助都将不胜感激。使用:
UIColor *color = ... // your selected color
CGContextSetStrokeColorWithColor(UIGraphicsGetCurrentContext(), color.CGColor);
或者干脆做:
[color set];
或:
CGContextSetStrokeColorWithColor(UIGraphicsGetCurrentContext(),color.CGColor);-工作得很好,非常感谢!
[color setStroke];