I would like to zoom the image to particular portion(user input coordinates) of the image.
When I click on a button I would like to zoom the image to particular coordinates of the image.
Can anyone help me out to find the zoom function?
Use view.setPivot before view.setScale
If you arent targeting API 11+ theres a calculation that took me 4 attempts along of 3 years to make it work, if you need it I can search after.
Related
I have a image received from server. I have to provide Zoom and Pan functionality to it.
I also receive set of point of image, when clicked on these point of image i need to show a pop up.
Initially i thought of using default viewer for image but the pop up of click of specific point is out of question.
I cannot slice the image also
Point me to proper direction.
I think this library fulfills your requirements: https://github.com/chrisbanes/PhotoView
I used https://github.com/ened/Android-Tiling-ScrollView library to display large tiled image. Everything is working fine. Only problem is that, I want to zoom only particular part which I touched(pinch-to-zoom as in Google map). Now, its always display tiles from beginning for all zoom levels irrespective of where I touched. Sometimes, it takes me near where I want to zoom but its not perfect as sometimes it takes me to different part. Following code does moving logic
mScroller.startScroll(getScrollX(), getScrollY(), newOffsetX, newOffsetY);
First 2 parameters indicate start scroll offset and last 2 indicates destination points to where scroll ends. I tried different combinations for last 2 parameters but ran out of luck.
If it's a ImageView, I would have done
canvas.translate(x, y);
to Zoom particular part but unfortunately its not ImageView. Even though I applied ImageView zoom logic as in https://github.com/jasonpolites/gesture-imageview to tile Zoom but had no luck.
Suggestions or clues are greatly appreciated.
Thanks.
Got a very nice library for custom mapView with almost all the features of google map. Its here.
I Never faced with the task to create a map of the shopping center (for example)
I did a project using a single image as a map, image was maximum size, but the image quality is not enough. I understand i need many small images. if user scrolling or zoom or fling map i programmatically change images...
but,I do not know where to begin, please help me your solutions
I would like to be able to view a rather large image (floor plan) that can be fully viewed by moving around the picture. When I click on the image, I would also like to get the coordinates on that image.
I've followed this tutorial 1 which works correctly and so allows me to move around the image. After that I also added some functionality to get the position of where I touch the screen. However, when moving around the image, black borders surround it (see picture below), which causes me to get incorrect coordinates.
So would somebody know how I could a) fix/remove the black borders when moving the image or b) correct the coordinates I receive by e.g. removing the border offset?
1 http://www.zdnet.com/blog/burnette/how-to-use-multi-touch-in-android-2-part-2-building-the-touch-example/1763
When you move around the image, set the scroll to stop before it reaches the edges of the image. Use this link for further details.
As for your coordinates, check these other 2 links: link1, link2.
Hope these would help you.
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.