In my app I am getting url of an image and I am loading that in webview. Here is if i zoomout at initial stage(like 100%) it should not zoom out. But once the zoom in has occured then it should be zoom out and here also it should not zoom out when it reaches to first position means(100%).
How can I achieve this. Can anyone help me.
Related
If you zoom in or zoom out in chrome, you'll find the window.devicePixelRatio changes too. But when you zoom in or zoom out in android webview, window.devicePixelRatio doesn't change at all. But the webview.scale does change. Why?
I searched many times about this question.But i got only Image Zoom in and zoom out examples.I tried to modify that codes only but image zoom uses setMatrix. So how can i set that matrix in videoview. Please help me by giving a small example.I implemented code within OnTouch().
I am using a WebView in Android. After loading a webpage I would like to use the on-screen Zoom out control. After one or two clicks it becomes grayed and no longer allows me to zoom out any further. When I call the zoomOut() function in code, it also does not zoom out any further.
What is limiting how much I can zoom out. I would expect to be able to zoom out much further than I am allowed - to the point of making the page too small to read. But, zoom out is disabled well before I reach this level of zoom.
Any help is greatly appreciated.
Thanks,
Barry.
You should probably do this myWebView.getSettings().setUseWideViewPort(true)
You'll then see that you can zoom out farther than what you usually see on default settings.
Take a look at WebView.setInitialScale(...) - I'm not sure if it will help you with what you want but setting it to 50, for example, will scale the WebView to 50% of its normal size. I think that will allow you to zoom in and then out again to the (initial) smaller size.
Hey Barry
The built in range for that zoomin and zoomout function is starts from 0.8 something that is the minimum value after this if you
will call the zoomout function it will return the false value and
maximum value for zoomin is upto 4.0 ,So these zoomin and zoomout
functions are of boolean type Like for a zoomin function wverytime you
call zoomin function it multiply with some factor and return true if
further zoomin is possible and whenever it reaches to the last point
that is 4.0 so it will return false and after that it will not zoom
in.
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 got frustated with zooming and panning issue of an image in android.I dont want to use sony zoom tutorial because i need zoom from buttons.
can anybody suggests me or provide me code to zoom an image with simple matrix calculation.
please do needful.