Browser Zoom Effect using WebRenderer


Duncan Thomas






We are often asked how our clients use WebRenderer in their projects. There are thousands of different use cases our ingenious clients have come up with that have both delighted and surprised us. WebRenderer is more than just an embeddable Java Swing browser. WebRenderer also gives you, the developer, complete access and control of the browser.

We thought we would put together an example that demonstrates some of the in-browser functionality. In this example we use WebRenderer Swing Edition to create a special “Zoom” effect when a click action is selected, like so:

The Zoom Browser demonstrates content being displayed on top of the Java browser in a glass pane. This content is an image taken from the browser itself and modified to give a scaled view. Click with the mouse scroll wheel to show. Scroll with the wheel, navigate to a new page or press ESC to remove the display.

How do we do this? When the click is made with the scroll wheel, a buffered image is created of the visible browser content using WebRenderer. The mouse cursor coordinates from the click are used to select a corresponding section of the buffered image. From here, the section is scaled (in this case double the size) and a new image is created of the section. This new image is drawn at the click position onto an overlay, which is used as a glass pane on top of the frame containing the browser.

As long as this sub-image exists, it will be drawn whenever the overlay is painted. Since scrolling or loading a new page would change the content, the sub-image is set to null, so that it will be removed from the overlay in these cases.

You can grab the source code for this here..
And for a free 30 day trial of WebRenderer Swing Edition, head over here..



These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • StumbleUpon
  • Reddit
  • DZone
  • Google Bookmarks
  • LinkedIn
  • TwitThis







About this blog..


This is an informal place for the team at JadeLiquid to discuss software, the rotation of the earth and other things usually discussed in the JadeLiquid corridors.




Subscribe: By Feed  By Email









Desktop Edition




Server Edition


Swing Edition









Recent Posts



Flash in Java browser - Enabling Flash within WebRenderer
Browser Zoom Effect using WebRenderer
WebRenderer Swing now supporting HTML5 video
Enabling HTML 5 WebSockets in WebRenderer
Applet deployment techniques for platform deterministic libraries






Popular Posts



WebRenderer Swing Edition 6 Released!
Deploying WebRenderer with Java Web Start on 64bit systems
Rich Test Browser - WebRenderer features on display
Flash in Java browser - Enabling Flash within WebRenderer
Enabling HTML 5 WebSockets in WebRenderer
WebRenderer Swing Edition 6.0 - 64bit beta ships
Browser Zoom Effect using WebRenderer
WebRenderer adds high performance Text Search and Highlight capability
WebRenderer Swing now supporting HTML5 video
Deploying WebRenderer Server Edition in Tomcat









September 2013 (1) May 2013 (1) January 2013 (1) November 2012 (2) October 2012 (1) September 2012 (1) May 2012 (1) November 2011 (1) October 2011 (2) September 2011 (1) August 2011 (1)





Millions of deployments and counting.. Users of JadeLiquid's tools can be found in every corner of the Earth




 > Enabling Flash in WebRenderer - Sept/2013
 > Browser Zoom Effect using WebRenderer - May/2013
 > Applet deployment techniques - Nov/2012
 > WebRenderer core features on display! - Sept/2012
   Additional News  
 > Enabling HTML 5 WebSockets in WebRenderer - Blog
 > 64bit WebRenderer deployment with Web Start - Blog
 > Deploying WebRenderer Server Edition in Tomcat - Blog
 > WebRenderer 6 adds performance text search - Blog


  Copyright JadeLiquid Software - 2015    Java and the Java Logo are trademarks or registered trademarks of Oracle Corporation in the United States and other countries  Privacy Policy  |  Disclaimer