I need to add a picture over a touched position in an image or directly on camera preview.
How could get the touch coordinates and set the image in the touched area?
And If I want to move the added images?
What is the right way to code this stuff? Is there some sample or tutorial?
event.getX() and event.getY() should give you the coordinates.
Here is a more detailed answer on getting the coordinates. Get the co-ordinates of a touch event on Android
Related
I am making an application that drag and drop images. I need to make the user of the app can move an image from one point to another of the screen, for example He will touch the image and drag it to a point on the screen where there is another image, and when both images are superimposed, a message on screen, how could I do it?
Thanks very much
I think this can help you with the drag and drop
https://www.youtube.com/watch?v=H3qr1yK6u3M
To know image position you need to work with the ontouchevent:
How to get the Touch position in android?
i want to use PDFNet to read and create some overlay image on top of PDF like marker on map. I don't know how to get touch position on PDF and how re-calculate that position then i make a move or zoom. Please tell me the way.
Thank you!
To get the touch position start with PreToolManagerListener.onSingleTapConfirmed method in ToolManager.java file. Once you have the touch position, which will be in screen coordinates, you would call PDFViewCtrl.convScreenPtToPagePt To get the coordinates in the particular PDF page. From there you can match up the page coordinates with your map marker.
PDFViewCtrl.convScreenPtToPagePt will handle all page transformations, including layout, zoom, position, rotation, etc.
I need to move the position of the image with the direction of finger in the easiest way possible.I found out the direction of the finger touch but I don't know how to move the image in the direction of finger.thanks in advance.
This tutorial will be helpful to you:
http://www.zdnet.com/blog/burnette/how-to-use-multi-touch-in-android-2-part-5-implementing-the-drag-gesture/1789?tag=content;siu-container
I am making an small application in android in which i used an image and i used two buttons here when i click the first button the image will zoom and when i click second button the image will zoom out. But now i want when the image will zoom i can able to move the image with mouse cursor in emulator or(by touch in devise) so that i can able to view the whole image after zooming.can you suggest me any idea .**
Thanks in advance!
Try just moving the initial drawing coordinates. For instance when the image is first shown, I would imagine that it is at 0,0. when you want to move the image just directly modify the start coords accordingly.
I try to make an application which place a certain png file in the screen with coordinates, and when the user clicks it, the image will move to another location in the screen.
can you guys give the sample..?? I'm kinda confused on how to draw the image (using bitmap or button??) and how to move it ??
THX for the answer...
refer this
Image in Canvas with touch events