Screenshot widget

This is a Vaadin widget taking client-side screenshots. Here is the demo:
http://sami.virtuallypreinstalled.com/screenshot

It lets the user to select any screen region (not only in the browser) and sends it back to the server. Here is a server-side usage sample:

win.addComponent(ss = new Screenshot());
ss.addListener(new Screenshot.Listener() {

    @Override
    public void screenshotReady(
            Screenshot screenshot) {

        // After screenshot is ready, show it
        image.setSource(screenshot.getScreenshotResource());
    }
});

ss.takeScreenshot();

The implementation is based on the AppletIntegration package and I have signed the demo jars with a self-signed certificate. If you plan to use this component in real application, please sign with you a valid certificate.

Again, source code in contrib:
http://dev.vaadin.com/svn/contrib/Screenshot/
and add-on jar as an attachement.
11226.jar (431 KB)

hi, i m new to vaadin and i wanted to ask something

if i wanted to use the screenshot add on,in my java class i have first to import the screenshot class right?

then add this code :

win.addComponent(ss = new Screenshot());
2ss.addListener(new Screenshot.Listener() {
3
4 @Override
5 public void screenshotReady(
6 Screenshot screenshot) {
7
8 // After screenshot is ready, show it
9 image.setSource(screenshot.getScreenshotResource());
10 }
11});
12
13ss.takeScreenshot();

Yes. Import the
org.vaadin.screenshot.Screenshot
. Also, before running the application you have to make sure you have put the add-on jar into WEB-INF/lib folder and recompiled the widgetset. In Eclipse, the plugin introduces a toolbar button for this, but in other environments you need to have an Ant task or similar.

There are general instructions how to use add-ons that might help:
vaadin.com/directory/help/using-vaadin-add-ons

The screenshot-0.9.4.jar file contains an org.vaadin.screenshot.no_image.gif.

I cannot seem to find any reference to it in the source at all.

What purpose does no_image.gif serve?

Hi,

The
no_image.gif
was only used in Screenshot demo, and should not even be in the package. I consider this as a bug in the packaging script. You can simply ignore (or remove) the file.

I tried this Add-On ( and also JS Screenshot) but ran into some problems. I used a similar code then in the first post but put the takeScreenShot on a buttonClick. When i click the button nothing happens (sometimes a loading indicator appears but that’s it). I also can’t get your demo to work. When i click on the button in your demo also nothing happens.

Is there a problem with the Browser, Vaadin or am i doing something else wrong?

PS: I have the same problem with JS Screenshot.

Don’t know about JS Screenshot, but the screenshot widget uses Java in the browser. If you’ve disabled running Java in the browser (with the recent list of vulnerabilities reported on enabling Java in the browser, many have disabled it), the plugin won’t work.

Hello! Excuse me, why source is not full? where is ScreenshotApplication.java?

Great Post!!! BugRem.com is easy to use. its indeed great for collecting general feedback… Try Now for free!!!