Div*_*ert 8 iphone core-graphics objective-c quartz-graphics ios4
我再次提出两个相互关联的问题
阴影创造不均匀.它们在某些方面变暗我正在添加我用来绘制线条的代码..
for (int i=0; i<[currentPath count]; i++)
{
CGPoint mid1 = [[self midPoint:[currentPath objectAtIndex:i+1] :[currentPath objectAtIndex:i]] CGPointValue];
CGPoint mid2 = [[self midPoint:[currentPath objectAtIndex:i+2] :[currentPath objectAtIndex:i+1]] CGPointValue];
CGContextMoveToPoint(context, mid1.x, mid1.y);
CGContextAddQuadCurveToPoint(context, [[currentPath objectAtIndex:i+1] CGPointValue].x, [[currentPath objectAtIndex:i+1] CGPointValue].y, mid2.x, mid2.y);
CGContextSetShadow(context, CGSizeMake(-2, -2), 3);
CGContextSetLineCap(context, kCGLineCapRound);
CGContextSetStrokeColorWithColor(context,[color CGColor]);
CGContextSetLineWidth(context, linewidth);
CGContextStrokePath(context);
i+=2;
}
Run Code Online (Sandbox Code Playgroud)
我找到了我的解决方案..问题非常愚蠢...我在每次迭代中都添加了导致问题的路径..现在我什至可以使用小于1的alpha进行绘制..
CGContextStrokePath(context);
Run Code Online (Sandbox Code Playgroud)
这条线超出了 for 循环..现在一切正常:)
| 归档时间: |
|
| 查看次数: |
1117 次 |
| 最近记录: |