Saving grid to jpeg format

Hi All,

Thanks you for your kind suggesstions.
We tried as you said in yesterday's mail. We tried to
create a thread in the captureDialog() method, and in
that method convertGridToImage(File f) is called.
     We are able to create a jpeg file of the grid
but, the entire grid is not saved. We have a 6 X 11
grid. Only the Bottom line of the grid is saved and is
visible as jpeg file. We are not able to see the whole
      Our application generates whole grid using VisAD
and it is fully visible as 6 X 11 grid.But when it is
saved as jpeg file only bottom line is visible. Please
help us.  


public  void convertGridToImage(File f) throws
FileNotFoundException, IOException, RemoteException,
VisADException {
        BufferedImage image = display.getImage();
        FileOutputStream fout;
        try {
            JPEGEncodeParam param
            param.setQuality(100, true);
            fout = new FileOutputStream(f);
            JPEGImageEncoder encoder
            encoder.encode(image, param);
        catch (NoClassDefFoundError err) {
            throw new VisADException("JPEG codec not
    public void captureDialog() throws VisADException,
        final File f = new File("c:/jpegfile.jpeg");
        if (f == null) return;
        Runnable captureImage = new Runnable() {
            public void run() {
                String msg = "Could not save image
snapshot to file \"" + f.getName() +
                "\" in JPEG format. ";
                try {
                catch (VisADException exc) {
                    System.out.println("Error in image
                catch (IOException exc) {
                    System.out.println("Error in image
        Thread t = new Thread(captureImage);


with regards,
Karan Kapoor.

Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger

  • 2001 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: