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.
Related
I have an array of position with latitude and longitude that are around the current user position, and i want display an image for every position of the array, if the user is looking in that direction Smart Glasses with Android (Moverio BT-200). I have made some research and I think I have to work with the Azimuth, in this way:
Get the GPS position of the user
Get the Azimuth
Define a distance view
Calculate the point inside that triangle to know what image of the array show to the user
This is more or less the summary, but I have another question, how can I let the user for example see only an half the image if he is looking in one position and the half image is in the edge of the screen?
Or how can I show the image behind the user when him for example turn back and during the movement let see him other image in the other position in the range of the distance view?
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
I want to add zooming effect to imageview.But i want this zooming effect from current position to specified position inorder to show other image at specified position.
Please help.
Thanks in advance.
look at this tutorial on how to zoom and pan an image and it is quite nice.
I'm loading floor plans into an Android application. I need the user to be able to identify problem areas on the floor plan with a single click. My thought process is to identify the click action, reload the html of the webview adding my marker asset to it at the specified location.
I've loaded the image into a webview to take advantage of zoom capabilities. I can get the X,Y coordinates of the webview where the click occurred, but I can't figure out how to get the current zoom level. Also, I'm not sure what math will be required to translate the X,Y,scale to actual pixel coordinates.
Is the webview the right view for me to use?
EDIT:
Using the link suggested below, I got the zoom functionality working. I still can't figure out how to place a drawable marker on top of the TouchImageView, much less get the coordinates that were actually touched on the image.
For your zoom question as well as coor, How can I get zoom functionality for images? should help you
The accepted answer does use a WebView, but the other answer uses a better approach for enabling zoom. It also provides the necessary math required for translating your X and Y coordinates into usable points.
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.