Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

Android: Does anyone know how to finger paint on an ImageView?

If so how would you go about doing it? Sorry the question is so vague. I honestly don't know where start!

1 Answer

Hi Tae

Not sure about drawing to an imageview as far as I understand it an imageview is simply a placeholder for storing static images (I may be wrong).

The way I would approach it would be to create a new SurfaceView class and draw to the canvas based to the X,Y position of the touch on screen, a useful tutorial I have used in the past can be found below (There is a whole set of tutorials from this person/organisation) they are not as structured as what treehouse has to offer but do show alternative techniques.

https://www.youtube.com/watch?v=Z2YogvILjvo

Hope this helps

Daniel

Thanks. I followed the answer left by Raghunandan from stack overflow.

http://stackoverflow.com/questions/15704205/how-to-draw-line-on-imageview-along-with-finger-in-android

He sets the image to a linear layout. All i have have to do now is figure out how to save the image to the gallery along with the finger paint. Would you happen to know how?