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

Everyone wants the rainbow - reduced IT costs, scalability, continuity, flexibility, manageability, ...
SYS-CON Events announced today that Silicon India has been named “Media Sponsor” of SYS-CON's 21st I...
We are seeing a major migration of enterprises applications to the cloud. As cloud and business use ...
SYS-CON Events announced today that CrowdReviews.com has been named “Media Sponsor” of SYS-CON's 22n...
Founded in 2000, Chetu Inc. is a global provider of customized software development solutions and IT...
DXWorldEXPO LLC announced today that "IoT Now" was named media sponsor of CloudEXPO | DXWorldEXPO 20...
Andi Mann, Chief Technology Advocate at Splunk, is an accomplished digital business executive with e...
Most DevOps journeys involve several phases of maturity. Research shows that the inflection point wh...
DXWorldEXPO LLC announced today that ICOHOLDER named "Media Sponsor" of Miami Blockchain Event by Fi...
Today, we have more data to manage than ever. We also have better algorithms that help us access our...
DXWordEXPO New York 2018, colocated with CloudEXPO New York 2018 will be held November 11-13, 2018, ...
Bill Schmarzo, author of "Big Data: Understanding How Data Powers Big Business" and "Big Data MBA: D...
DevOpsSummit New York 2018, colocated with CloudEXPO | DXWorldEXPO New York 2018 will be held Novemb...
@DevOpsSummit at Cloud Expo, taking place November 12-13 in New York City, NY, is co-located with 22...
CI/CD is conceptually straightforward, yet often technically intricate to implement since it require...
The now mainstream platform changes stemming from the first Internet boom brought many changes but d...
Bill Schmarzo, Tech Chair of "Big Data | Analytics" of upcoming CloudEXPO | DXWorldEXPO New York (No...
CloudEXPO New York 2018, colocated with DXWorldEXPO New York 2018 will be held November 11-13, 2018,...
SYS-CON Events announced today that IoT Global Network has been named “Media Sponsor” of SYS-CON's @...
DXWorldEXPO | CloudEXPO are the world's most influential, independent events where Cloud Computing w...