Safari
Safari

Reputation: 11935

Quartz line with a strange texture

Is it possible to draw a line with a strange texture in Quartz? This is an example of the texture.!

enter image description here

Upvotes: 1

Views: 135

Answers (2)

justin
justin

Reputation: 104698

One approach: Draw diagonal lines (e.g. using CGContextAddLineToPoint) after clipping the rect (CGContextClipToRect).

Upvotes: 0

Chuck
Chuck

Reputation: 237040

Yes. It somewhat depends on how you're drawing the line. Here's one option: Make an image containing the pattern you want, then create an UIColor using [UIColor colorWithPatternImage:] and set that as the current stroke color and then draw a line.

Upvotes: 1

Related Questions