小编use*_*069的帖子

核心图形 - 以一定角度绘制线条

我一直在寻找挣扎这一段时间,需要一些帮助.我只想从我的显示器中心(160,200)以14.4度的间隔绘制25条线.我一直在for循环中使用这行代码,其中x是14.4度乘数 -

    UIImage*backgroundImage = [UIImage imageNamed:@"Primate Background Only.png"];
[backgroundImage drawInRect:CGRectMake(0, 0, 320, 480)];
Run Code Online (Sandbox Code Playgroud)

//画出外圈

rect = CGRectMake(0.0, 35.0, 320.0, 320.0);     
CGContextRef contextRef = UIGraphicsGetCurrentContext();                // Get the contextRef
CGContextSetLineWidth       (contextRef, 0.5);                  // Set the border width
CGContextSetRGBFillColor    (contextRef, (219.0f/255.0f), (219.0f/255.0f), (219.0f/255.0f), 0.05f);             // Set the circle fill color to GREEN
CGContextSetRGBStrokeColor  (contextRef, 0.0, 0.0, 0.0, 0.2);           // Set the circle border color to BLACK     
CGContextFillEllipseInRect      (contextRef, rect);                 // Fill the circle with the fill color
CGContextStrokeEllipseInRect    (contextRef, rect);                 // Draw …
Run Code Online (Sandbox Code Playgroud)

iphone core-graphics objective-c

11
推荐指数
1
解决办法
4652
查看次数

标签 统计

core-graphics ×1

iphone ×1

objective-c ×1