3 Replies Latest reply: May 11, 2010 11:38 PM by 843802 RSS

    draw geotiff in a JFrame

      Hi: However I found that some geotiff image can be displayed in a JFrame,however others can not.

      The core codes:
        PlanarImage resultImage = null;
        InputStream is = null;
        try {
         is = new FileInputStream(new File("D:/wu.tif"));
        } catch (FileNotFoundException e) {
         // TODO Auto-generated catch block
        SeekableStream seekableStream = SeekableStream.wrapInputStream(is, true);
        ParameterBlock pb = new ParameterBlock();
        resultImage = JAI.create("TIFF", pb);
        JFrame jf=new JFrame("Geo");
        Graphics g=jf.getGraphics();
        g.drawImage(resultImage.getAsBufferedImage(), 0, 0, null);
      The two geotiff, usa.tiff and wu.tif, the wu.tif can not drawed in the JFrame, it is a black blank.

      I wonder why?

      The files can be found there :



      I hope someone can check it for me ,thanks.