Drawing a line with a brush in iOS <p>there are so many posts here, were people ask how to draw lines with a brush in CGContext. The answer always is: Use a pattern. However, I tried this for some hours now and the main problem to me seems to be: It seems like CoreGraphics simply draws the pattern as a fill and then simply clips this pattern with the stroke of the path you specified. This leads to some bad looking tile-borders and it simply doesn't look as someone really draws something by hand. What I want is something were the brush is painted along the path, without any clipping. I basically want to move along the path and simply draw the brush image every x points, in distance, on the path, with the size of the brush. Is this somehow possible with CoreGraphics or is this just something you have to implement on your own?</p> <p>//EDIT: Sorry, I thought it was clear what I tried by saying, I used a pattern. This is what I did so far:</p> <pre><code>struct CGPatternCallbacks patternCallback = {0, drawChalkPattern, NULL}; CGAffineTransform patternTransform = CGAffineTransformMakeScale(.25f, .25f); UIImage* brush = [UIImage imageNamed:@"ChalkBrush"]; CGPatternRef pattern = CGPatternCreate(NULL, (CGRect){CGPointZero, brush.size}, patternTransform, brush.size.width, brush.size.height, kCGPatternTilingConstantSpacingMinimalDistortion, true, &amp;patternCallback); CGColorSpaceRef patternSpace = CGColorSpaceCreatePattern(NULL); CGContextSetStrokeColorSpace(context, patternSpace); CGFloat color[4] = {1.0f, 1.0f, 1.0f, 1.0f}; CGContextSetStrokePattern(context, pattern, color); CGContextDrawPath(context, kCGPathStroke); </code></pre> <p>and than this is the patternCallback function:</p> <pre><code>void drawChalkPattern(void * info, CGContextRef context) { UIImage* pattern = [UIImage imageNamed:@"ChalkBrush"]; CGContextDrawImage(context, (CGRect){CGPointZero, pattern.size}, [pattern CGImage]); } </code></pre> <p>Best regards, Michael</p>