views:

39

answers:

1

Trying to figure out how can I create a screencapture applet like screenr.com does .. i want to be able to produce a similar result.

I found that there are ways to capture screenshot.. from a signed applet.. but can't seem to find any information on video capture.

thoughts?

+1  A: 

Use java.awt.Robot to take screenshot .... This is simple Java code snippet .. you can break the video in individual frames and then use the capture code...

import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import java.io.File;

import javax.imageio.ImageIO;

public class FilePrinter 
{
public static void main(String[] args) {
    try {
        Robot robot = new Robot();
        Rectangle captureSize = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
        BufferedImage bufferedImage = robot.createScreenCapture(captureSize);
        ImageIO.write(bufferedImage, "png", new File("c:/temp/test.png"));
    }
    catch(Exception e) {
        System.err.println("Someone call a doctor!");
    }

}
}

Hope this will be useful ...

Update: Refer to the following link for getting individual frames. The guy is using 'Java Media Framework' to do that ...

http://forums.sun.com/thread.jspa?threadID=421678&start=0

Regards,

Favonius
Thanks for the help.I can capture the screenshots but how do I capture it as a video? The link talks about how to get picture frames from a video.. i am kinda looking for the other way around.
John Stewart