Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 04-13-2009, 04:22 PM   #1 (permalink)
Registered Member
 
Join Date: Jun 2008
Posts: 252
elektrobank is an unknown quantity at this point
Default Simple paint app?

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?
elektrobank is offline   Reply With Quote
Old 04-13-2009, 04:27 PM   #2 (permalink)
New Member
 
Join Date: Mar 2009
Location: Silicon Valley, CA
Posts: 135
AEDave is on a distinguished road
Default

There's an entire chapter in Beginning iPhone Development by Mark & LaMarche on this, I'd start there.

Dave
AEDave is offline   Reply With Quote
Old 04-13-2009, 05:40 PM   #3 (permalink)
Registered Member
 
Join Date: Jun 2008
Posts: 252
elektrobank is an unknown quantity at this point
Default

I don't have that book and the source code for the book doesn't contain that example. Any others?
elektrobank is offline   Reply With Quote
Old 04-14-2009, 10:38 AM   #4 (permalink)
Registered Member
 
Join Date: Nov 2008
Posts: 812
johnqh is on a distinguished road
Default

Quote:
Originally Posted by elektrobank View Post
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.
johnqh is offline   Reply With Quote
Old 04-16-2009, 11:57 PM   #5 (permalink)
Registered Member
 
Join Date: Jun 2008
Posts: 252
elektrobank is an unknown quantity at this point
Default

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 View Post
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.
elektrobank is offline   Reply With Quote
Old 04-17-2009, 09:40 AM   #6 (permalink)
iPhone Developer
 
Join Date: Sep 2008
Location: Canada
Posts: 159
Henning is on a distinguished road
Default

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.
Henning is offline   Reply With Quote
Old 04-18-2009, 10:32 AM   #7 (permalink)
Registered Member
 
Join Date: Jun 2008
Posts: 252
elektrobank is an unknown quantity at this point
Default

If it's online somewhere, could you post the link, I'd like to check it out.
Thanks!
elektrobank is offline   Reply With Quote
Old 04-20-2009, 07:58 AM   #8 (permalink)
iPhone Developer
 
Join Date: Sep 2008
Location: Canada
Posts: 159
Henning is on a distinguished road
Default

Yes, sorry I forgot to look it up when I was home. Next time I have access to my bookmarks I'll try to remember to post it.
Henning is offline   Reply With Quote
Old 04-22-2009, 03:06 PM   #9 (permalink)
iPhone Developer
 
Join Date: Sep 2008
Location: Canada
Posts: 159
Henning is on a distinguished road
Default

Here's the Quaartz painting source code I found. Please tell me if it works smoothly for you:

[Tutorial] Drawing to the screen. - iPod touch Fans forum

I still need to find the OpenGL painting one ...

Last edited by Henning; 04-22-2009 at 03:09 PM.
Henning is offline   Reply With Quote
Old 08-07-2009, 07:55 AM   #10 (permalink)
UK based App Developers
 
Join Date: Feb 2009
Location: Bath, UK
Posts: 42
YARG is on a distinguished road
Default

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 :-~
YARG is offline   Reply With Quote
Old 04-11-2010, 07:52 PM   #12 (permalink)
Registered Member
 
Join Date: Apr 2010
Posts: 2
amit.agrawal is on a distinguished road
Default

Quote:
Originally Posted by QuantumDoja View Post
Did anyone get an open gl version of this?
There is "GLPaint" from the Apple website... just search for it when you log into the developer section.
amit.agrawal is offline   Reply With Quote
Old 04-11-2010, 11:10 PM   #13 (permalink)
Gold Orange
 
orange gold's Avatar
 
Join Date: Sep 2008
Posts: 686
orange gold is an unknown quantity at this point
Default

download my sample project drawing app here.

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.
orange gold is offline   Reply With Quote
Old 07-15-2010, 04:47 PM   #14 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 3
isaacueca is on a distinguished road
Default Awesome

This is pretty awesome. THank you so much for sharing it
isaacueca is offline   Reply With Quote
Old 07-16-2010, 01:45 AM   #15 (permalink)
UK based App Developers
 
Join Date: Feb 2009
Location: Bath, UK
Posts: 42
YARG is on a distinguished road
Default Circles

Quote:
Originally Posted by orange gold View Post
download my sample project drawing app here.

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!)

Cheers

Steve
Attached Images
File Type: jpg Drawing-Circle.jpg (4.7 KB, 46 views)
YARG is offline   Reply With Quote
Old 07-16-2010, 04:49 PM   #16 (permalink)
iOS Developer
 
chaseacton's Avatar
 
Join Date: Feb 2009
Location: United States
Posts: 541
chaseacton is on a distinguished road
Send a message via AIM to chaseacton Send a message via Skype™ to chaseacton
Default

I have a non-GL version that's pretty nice if you'd like to buy it. It was never released to the app store. I'd sell it for $10-$15
__________________
Freelance Inquiries:
www.chaseacton.com/services

Apps:
chaseacton is offline   Reply With Quote
Old 09-01-2010, 08:38 PM   #17 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 138
rrichar is on a distinguished road
Default

Quote:
Originally Posted by orange gold View Post
download my sample project drawing app here.

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.
rrichar is offline   Reply With Quote
Old 09-01-2010, 10:42 PM   #18 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 138
rrichar is on a distinguished road
Default

Quote:
Originally Posted by orange gold View Post
download my sample project drawing app here.

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.
rrichar is offline   Reply With Quote
Old 02-11-2011, 09:49 PM   #19 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 1
tonywlsn is on a distinguished road
Default

Quote:
Originally Posted by YARG View Post
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.
tonywlsn is offline   Reply With Quote
Old 05-10-2011, 04:47 AM   #20 (permalink)
Registered Member
 
Join Date: May 2011
Location: New Delhi, India
Posts: 1
AKRATI is on a distinguished road
Smile Thanks

Quote:
Originally Posted by orange gold View Post
download my sample project drawing app here.

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.

Cheers!!
AKRATI is offline   Reply With Quote
Old 06-28-2011, 07:31 PM   #21 (permalink)
Registered Member
 
Join Date: Jun 2011
Posts: 2
rwehner186 is on a distinguished road
Default Erase?

Quote:
Originally Posted by orange gold View Post
download my sample project drawing app here.

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?

Thanks!
rwehner186 is offline   Reply With Quote
Old 06-29-2011, 06:30 AM   #22 (permalink)
Registered Member
 
Join Date: Feb 2011
Posts: 11
01.vipin is on a distinguished road
Default How to make eraser using ur code

Please give me a sample code to make eraser
01.vipin is offline   Reply With Quote
Old 12-31-2011, 12:23 PM   #23 (permalink)
Registered Member
 
Join Date: Dec 2011
Posts: 1
mac4all is on a distinguished road
Default

hi i am newbie can you say what features it have and how can i change color and...
mac4all is offline   Reply With Quote
Old 01-02-2012, 04:21 AM   #24 (permalink)
Registered Member
 
Join Date: Feb 2011
Posts: 11
01.vipin is on a distinguished road
Default Mail ID

Please give me the mail ID, i will send u the sample code.
01.vipin is offline   Reply With Quote
Old 01-11-2012, 02:58 AM   #25 (permalink)
Registered Member
 
Join Date: Jan 2012
Posts: 2
zaffer125 is on a distinguished road
Default

Quote:
Originally Posted by 01.vipin View Post
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.

Thanks
Zaffer
zaffer125 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 324
6 members and 318 guests
blueorb, guusleijsten, jbro, Kryckter, n00b, SLIC
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,649
Threads: 94,113
Posts: 402,880
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Anwerbl
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 08:58 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0