0

As per my project requirement, I wanted to create a brush which will give me a effect like oil/water painting. Please find attached snaps of it. I've taken this snap from Microsoft Paint Application. Microsoft Paint provides different brushes and one of them is Oil Brush.

After keen observation, I noticed that the complete pattern used in microsoft paint is hard-coded. For every stoke(with any color) it gets repeated.

My requirement are flexible, either i can implement fixed brush style or it can be random pattern.

I wanted to know, which API to use so that my solid fill line will look like a oil paint or water color painting.

I've created a sample application which uses NSBezierPath to draw a path but NSBezierPath doesn't have any functionalities using which i can provide such effects to it.

Regards Omkar

Omkar
  • 1,108
  • 10
  • 19
  • http://www.allaboutiphone.net/2009/09/app-review-brushes/ – iPatel Jan 26 '13 at 13:21
  • I went through the link you have provided, it talks about the review of apps which are able to generate paint brushes. I wanted to create similar app which should be able to draw oil/water color paining. Need some API reference using which i can crate oil paint effect on a solid line. – Omkar Jan 26 '13 at 13:48

1 Answers1

0

I solved it using NSColor class API

NSImage* anImage; // Create an image with any brush pattern
[[NSColor colorWithPatternImage:anImage]

I created a small image say 25x25 out of a oil paint brush pattern created in MS Paint application and provided the path to anImage object.

in drawRect before drawing the NSBezierPath I set the color using above image object.

Omkar
  • 1,108
  • 10
  • 19