Win a copy of Pragmatic AI this week in the Artificial Intelligence forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

How to Set zoom level of image in java  RSS feed

 
Ranch Hand
Posts: 406
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Niti Kapoor
Ranch Hand
Posts: 406
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
as i had search for it i had seen using selenium but i want to set using java.
 
Saloon Keeper
Posts: 4707
117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like the code needs to remember the zoom level, and apply it to all images until it is changed again.
 
Niti Kapoor
Ranch Hand
Posts: 406
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes tim that is only im asking hw can i do it

 
Tim Moores
Saloon Keeper
Posts: 4707
117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Niti Kapoor
Ranch Hand
Posts: 406
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the image code is this one only its is loading in webview
 
Tim Moores
Saloon Keeper
Posts: 4707
117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Niti Kapoor
Ranch Hand
Posts: 406
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

this is display code
 
Tim Moores
Saloon Keeper
Posts: 4707
117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Niti Kapoor
Ranch Hand
Posts: 406
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
whatever webview means
 
Niti Kapoor
Ranch Hand
Posts: 406
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basically i want to set one zoom level in a variable so if it load other image should load with same level.
 
Tim Moores
Saloon Keeper
Posts: 4707
117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!