I need some sample code that will simply allow me to paint on the screen using a finger. There is a tutorial on this site for this, but the drawing is slow and produces jagged lines as you draw, instead of smooth curves. Does anyone have an example of some simple drawing code that works properly?
I need some sample code that will simply allow me to paint on the screen using a finger. There is a tutorial on this site for this, but the drawing is slow and produces jagged lines as you draw, instead of smooth curves. Does anyone have an example of some simple drawing code that works properly?
The problem is that the touch event is not fired continuously. The better painting apps curve the path themselves, and that's pretty advanced math.
No, I have not done a painting app, only have some general idea about it.
Are you sure that's why? To test this, I tried using an iPhone VNC program to draw something in photoshop from my iPhone, and it came out very smooth. If the touch event wasn't fired continuously, then it should have draw the same way as on screen, right?
Quote:
Originally Posted by johnqh
The problem is that the touch event is not fired continuously. The better painting apps curve the path themselves, and that's pretty advanced math.
No, I have not done a painting app, only have some general idea about it.
I'm having the same problem (using Quartz). I found a sample online that uses OpenGL which works pretty well, but I need to do this in Quartz.
I found another sample which provided just the drawing, but it suffered from the same problem. Other people using the same sample (it was just a class, not the whole project) didn't seem to have the same problem (at least, nobody complained), which I thought was weird.
Did anyone find an answer to this as I've got the same problem, I also had a look at [Tutorial] Drawing to the screen. - iPod touch Fans forum but is has the same problem. Try drawing a circle with your finger fast and you'll see what I mean :-~
there are side notes in my code on how to change the color (RGB), size, and brush shape (Circle, Round, Butt [looks like a sticky note pattern]), and alpha (opacity 0.0 - 1.0)
good luck people
__________________
APPS4LIFE
search for me in the app store.
Last edited by orange gold; 04-11-2010 at 11:14 PM.
there are side notes in my code on how to change the color (RGB), size, and brush shape (Circle, Round, Butt [looks like a sticky note pattern]), and alpha (opacity 0.0 - 1.0)
good luck people
For some reason I missed the notification email about this post so sorry for the delay. Thanks for posting the code but it still has the same problem as all of the CGContext based Apps have, try and draw a circle fast .. you can't (see attached). Has anyone solved this yet? I've tried a load of things but I've still not been able to do it on the device, the simulator is fine (as the Mac is faster!)
there are side notes in my code on how to change the color (RGB), size, and brush shape (Circle, Round, Butt [looks like a sticky note pattern]), and alpha (opacity 0.0 - 1.0)
good luck people
Tried you app but you built it using sdk 3.1.3. I have SDK 4.00.
there are side notes in my code on how to change the color (RGB), size, and brush shape (Circle, Round, Butt [looks like a sticky note pattern]), and alpha (opacity 0.0 - 1.0)
good luck people
got your app working all it does is draw a bunch of circles in a line. Then when you take you finger off to draw another line all it does s move the first line you draw. Is there a way of fixing this ? Also I need a clear button.
For some reason I missed the notification email about this post so sorry for the delay. Thanks for posting the code but it still has the same problem as all of the CGContext based Apps have, try and draw a circle fast .. you can't (see attached). Has anyone solved this yet? I've tried a load of things but I've still not been able to do it on the device, the simulator is fine (as the Mac is faster!)
Cheers
Steve
Hmmm, I know you chased this issue a long while ago but I'm curious whether or not you came across a solution. I have the same problem and I'm looking for insight. thanks.
there are side notes in my code on how to change the color (RGB), size, and brush shape (Circle, Round, Butt [looks like a sticky note pattern]), and alpha (opacity 0.0 - 1.0)
good luck people
Thanks a lot for sharing this, it really helped me a lot.
there are side notes in my code on how to change the color (RGB), size, and brush shape (Circle, Round, Butt [looks like a sticky note pattern]), and alpha (opacity 0.0 - 1.0)
good luck people
I have created buttons to change the paint brush color, but does anyone know how I can add the functionality to erase or clear lines that have been drawn?
Please give me the mail ID, i will send u the sample code.
Hi,
I am a newbie in iPad development. I need to create a notes app where the user will write notes with stylus or finger, and ability to erase. Can someone share sample app to give me a headstart.