Digital Edition

SYS-CON.TV
Browser Zoom Effect Using WebRenderer
Using WebRenderer Swing Edition to add effects to browser

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:

WebRenderer Swing Edition with Zoom

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..

About Duncan Thomas
Duncan Thomas, VP of sales at JadeLiquid Software, is a tech guy caught up in the business of tech!



ADS BY GOOGLE
Subscribe to the World's Most Powerful Newsletters

ADS BY GOOGLE

Widespread fragmentation is stalling the growth of the IIoT and making it difficult for partners to ...
In his session at 21st Cloud Expo, Carl J. Levine, Senior Technical Evangelist for NS1, will objecti...
"MobiDev is a software development company and we do complex, custom software development for everyb...
Agile has finally jumped the technology shark, expanding outside the software world. Enterprises are...
Enterprises are adopting Kubernetes to accelerate the development and the delivery of cloud-native a...
In his session at 21st Cloud Expo, James Henry, Co-CEO/CTO of Calgary Scientific Inc., introduced yo...
While some developers care passionately about how data centers and clouds are architected, for most,...
"NetApp is known as a data management leader but we do a lot more than just data management on-prem ...
The question before companies today is not whether to become intelligent, it’s a question of how and...
"Akvelon is a software development company and we also provide consultancy services to folks who are...
Coca-Cola’s Google powered digital signage system lays the groundwork for a more valuable connection...
"We're focused on how to get some of the attributes that you would expect from an Amazon, Azure, Goo...
"Codigm is based on the cloud and we are here to explore marketing opportunities in America. Our mis...
Data scientists must access high-performance computing resources across a wide-area network. To achi...
"CA has been doing a lot of things in the area of DevOps. Now we have a complete set of tool sets in...
High-velocity engineering teams are applying not only continuous delivery processes, but also lesson...
"Cloud Academy is an enterprise training platform for the cloud, specifically public clouds. We offe...
"We're developing a software that is based on the cloud environment and we are providing those servi...
SYS-CON Events announced today that CrowdReviews.com has been named “Media Sponsor” of SYS-CON's 22n...
SYS-CON Events announced today that Telecom Reseller has been named “Media Sponsor” of SYS-CON's 22n...