I'm here again with two Questions, both interconnected
- I want to draw embossed lines with the main graphics. Can someone suggest me how to give the inner shadows a line drawn on touch events?
- Even for drawing outer shadows. The shadow overlay overlaps between them. and the line drawn in colors other than black looks like a worm .. Can someone help me? The following image illustrates what I would like to explain for Question 2:
Shadows are not even created. They darken at some points.
I am adding code that I use to draw strings.
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; }
objective-c iphone ios4 core-graphics quartz-graphics
Divinedester
source share