i want to smooth and curve draw line on finger touch and using only UIBezierPath.i am new for drawing concept in iOS and i need any example or code and how to do it like my requirement can any one guide me with greatly appreciated!
Thanks in Advance!
I have one example for free hand drawing but one problem is it is not much smoother but you can have one starting point using this example.
Happy Coding :)
Related
I am trying to draw CGPaths using CAShapeLayer. I want to change the color of the parts where lines are intersected.
Following screenshots explain the goal easier.
http://a5.mzstatic.com/us/r1000/046/Purple/a3/9b/29/mzl.pocvbqdb.320x480-75.jpg
http://a3.mzstatic.com/us/r1000/037/Purple/1d/54/44/mzl.dpijulvx.320x480-75.jpg
Check #Alex Nichol's Answer on this post, How to determine intersection of CGPaths .
He developed an Open Source solution to CGPath collision detection, as well as a youtube video showing it in Action.
Hope this helps !
Currently i am working in simple game application, using GL_Line to draw a line and its working fine, then i tried to add (Anchor) image, at the end of the line. but i cannot know, How to fix this?, so can any one help me?
Why don't you draw a textured quad to get this done?
You can just glTranslate to the end of the line and draw the quad.
i want to draw curve with user touches two points perfectly...!but,no idea for this implementation for this functionality...!
Help with me any code or tutorial with greatly appreciated....!
Thanks...!
Look at apple's 'Drawing Shapes Using Bezier Paths' guid.
Recently i discovered andengine and I'm playing a little with it.
I would like to put a picture in background and cover it with a solid colored rectangle, and be able to cut out polygon shaped parts from the rectangle to unveil the portion of the underlying picture corresponding to that polygon... I hope I explained myself.
I'm not focusing on the polygon shape, it could also be a rectangle or a circle.
Thx in advance for your suggestions
this is a more complex problem than it sounds.
You could play around with some uncommon Blendfunctions. This could work like drawing the uncovered polygons first and blending the image only where there is a high saturation or so...
Alternatively you would seek for sth like a RenderTexture and dynamically make it more transparent where it is touched. This requires the FBO Extension, which is a core part of GLES2 and optional on GLES1.
I hope this helped :-)
Best Regards,
Nicolas
I'm looking for a way to draw a curve (perhaps a parametric function?) into a CGContext
The best example which I can think of is the Adobe Ideas iPad application. As the user drags their finger, the application draws lines for every touchesMoved: using CGContextAddLineToPoint. After the user picks up their finger at touchesEnded:, the application does some math and replaces all of the lines with a single, smoothed curve.
What I have is a list of CGPoints, and I am looking to draw a smooth curve which follows those CGPoints into the CGContext.
Any assistance?
I'd advise creating a CGPathRef and use the CGPathAddQuadCurveToPoint method.
Hope this helps!