0

As a part of my application,

I have implemented a sample paint by following RayWendrlich Simple Drawing App with UIKit

I almost completed my application with all requirements

By this i can able to draw but the lines are not smooth when we draw cross or, curves..

While surfing i found that we can able to make smooth with Bezier Path,

How should i use this bezier path in my app easy, can any help please.

Thanks

user2732294
  • 641
  • 2
  • 10
  • 21

2 Answers2

1

You can draw using.

UIBezierPath *aPath = [UIBezierPath bezierPath];
[aPath moveToPoint:CGPointMake(p1.x, p1.y)];
for (uint i=1; i<points.count; i++)
{
    CGPoint p = [points objectAtIndex:i]
    [aPath addQuadCurveToPoint:CGPointMake(p.x, p.y) controlPoint:controlPoint];
}
[aPath closePath];
[aPath fill];

For more information you can follow UIBezierPath Class Reference

Here is nice example

Rajneesh071
  • 30,846
  • 15
  • 61
  • 74
  • Do either of you know hot to implement with Spritekit? Using the ACEDrawingTools example (awesome, btw), I want to use the exact same line function, but with Spritekit. – Doug Mar 11 '14 at 14:37
  • http://stackoverflow.com/questions/19092011/how-to-draw-a-line-in-sprite-kit/19092449#19092449 – Rajneesh071 Mar 12 '14 at 04:50
0

you can use uibezirpath for drawing path when touch end you can capture that uiview to image and setbackground of the uiview and clear path this will done smooth drawing app