Forums Register Login
How to Set zoom level of image in java
as i had set zoom in and zoom out property but i have to set zoom level so when i zoom one picture the next picture will come in same zoom level

This is zoom part of code
as i had search for it i had seen using selenium but i want to set using java.
Sounds like the code needs to remember the zoom level, and apply it to all images until it is changed again.
yes tim that is only im asking hw can i do it

Instead of just setting the zoom level to "img.getZoom() [*/] 1.1", you need to store that value in a variable, and then set the zoom level of the next image to that value once it gets displayed. We can't say how that might work as we haven't seen the relevant code.
the image code is this one only its is loading in webview
That code doesn't load or show any images, it merely sets the zoom level. So some other code must be doing the displaying. For example, where does "img" come from?

I can't tell what your mention of a webview is supposed to mean; as I've told you before repeatedly, you're giving us not enough information to help you: TellTheDetails

this is display code
So you're meddling around with an existing web page, and want to scale images in that web page? Assuming that the "next image" you're talking about is loaded by some Javascript in the page (is it? TellTheDetails), it seems you need to tap into that Javascript code to be notified if another image is loaded. I don't know if that's possible with whatever webview that is you're using.
whatever webview means
Basically i want to set one zoom level in a variable so if it load other image should load with same level.
What I meant is: we don't know what this "webview" component is you mentioned, so we can't begin to speculate what it might or might not be capable of doing.

You also didn't tell us how the "other images" are loaded (I asked whether that happens by Javascript - you didn't answer that), so there, too, we can't advise further.

It all comes back to this: you're providing too few details for us to help you effectively. Please consider that before your next post: HowToAskQuestionsOnJavaRanch

It would also help if you can point us to the web page in question, assuming that it is public.

Basically i want to set one zoom level in a variable so if it load other image should load with same level.

Surely the storing of a value in variable, and later using it, isn't a problem?

This thread has been viewed 464 times.

All times above are in ranch (not your local) time.
The current ranch time is
Oct 20, 2018 19:12:33.