draw a geotiff image in the JFrame

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

draw a geotiff image in the JFrame

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();
        PlanarImage resultImage = JAI.create("tiff", pb);
        JPanel jp=new JPanel();
        JFrame jf=new JFrame();
        jf.setSize(1100, 800);
        Graphics g=jf.getGraphics();
        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?

Geotiff mailing list
[hidden email]