[Geotiff] draw a geotiff image in the JFrame

maven apache apachemaven0 at gmail.com
Wed Apr 28 18:42:29 PDT 2010


Hi:
I tried to draw a tiff image in my JFrame,however I found some strange thing
.
The core codes I use are shown in the following:
--------------
        SeekableStream seekableStream =
SeekableStream.wrapInputStream(Test.class.getResourceAsStream("Test.tif"),
true);
        ParameterBlock pb = new ParameterBlock();
        pb.add(seekableStream);
        PlanarImage resultImage = JAI.create("tiff", pb);

        JPanel jp=new JPanel();
        JFrame jf=new JFrame();
        jf.setSize(1100, 800);
        jf.setVisible(true);
        Graphics g=jf.getGraphics();
        g.setColor(Color.BLUE);
        g.drawImage(resultImage.getAsBufferedImage(), 0, 0, null);
----------------
However the tiff is  blank in my frame,then I open this tiff with arcgis, it
is also a black blank, but I can classify it, then the tiff is colorful.

Then  export this tiff from the from without the corrdinate information, it
can be shown with color in the JFrame.

I wonder why?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geotiff/attachments/20100429/a637f214/attachment.html>


More information about the Geotiff mailing list