[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Screen capture to an image file - GIF, JPEG, whatever



I think JAI is what you need.  Go to java.sun.com and look at products and
then find Java Advanced Imaging (JAI).  Install JAI into your JDK and then
you can write some code that uses JAI to write a BufferedImage to a file.
You can create jpg or tiff or png or bitmap, but not gif.  I'll send you
some sample code I wrote to save reports to disk from a print preview
window.  Remember also to include JAI in your setup distribution so that it
gets put into your user's JRE.

Ed

----- Original Message -----
From: "Chris Abney" <chrisabney@hotmail.com>
To: <ajug-members@ajug.org>
Sent: Thursday, July 12, 2001 12:20
Subject: Screen capture to an image file - GIF, JPEG, whatever


Hi all,

I have been wrestling with this task and I hope I haven't overlooked
something easy.
If I have, will someone please disappoint me?

I know I can use java.awt.Robot to capture the screen to an Image
(BufferedImage).
But I don't know how to convert the raw image data to a standard format.

I can't use a third party component that involves licensing or anything like
that.

Is there a reasonable way to do this?


Thanks
Chris
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com