Drawing lines over images

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Drawing lines over images

Postby dilip@cmu.edu » Fri Nov 20, 2009 12:04 pm

Hi all,

I am trying to draw lines over images. In more detail, I am trying to simulate the "draw" functionality over the Power point slides. So if I click and drag on my android screen (over an image), i need to have a line drawn over the image. Can someone please suggest me on how to go about it?

Thanks,
Dilip
dilip@cmu.edu
Freshman
Freshman
 
Posts: 4
Joined: Thu Nov 19, 2009 2:47 am
Location: Pittsburgh

Top

Postby I_Artist » Fri Nov 20, 2009 2:31 pm

This question has been answered before...
The I_Artist

follow me on Twitter: @I_Artist
follow Android Development on Twitter: #androiddev

Show the world that you are an #androiddev, wear the badge http://www.twibbon.com/join/androiddev
User avatar
I_Artist
Developer
Developer
 
Posts: 33
Joined: Fri Oct 16, 2009 3:49 am
Location: St-Eustache, Quebec

Postby dilip@cmu.edu » Fri Nov 20, 2009 5:11 pm

Dear I_Artist,

Can you please send me the link for the answer... :roll: I tried searching the forum, but in vain.. It would be really helpful if you could direct me towards the solution or the link.. :?
dilip@cmu.edu
Freshman
Freshman
 
Posts: 4
Joined: Thu Nov 19, 2009 2:47 am
Location: Pittsburgh

Postby nithin.warier » Mon Nov 23, 2009 11:41 am

Hi Dilip,

In onTouchEvent(), MoitionEvent.ACTION_DOWN, take the x & y co-ordinate at that point, using getX() and getY() and in MotionEvent.ACTION_UP also, take the x & y co-ordinate. and draw line according to the co-ordinates.

Thanks
smartandroidians.blogspot.com
nithin.warier
Experienced Developer
Experienced Developer
 
Posts: 87
Joined: Thu Feb 28, 2008 12:05 pm
Location: Malappuram Kerala India

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Exabot [Bot] and 7 guests