[Geotiff] draw a geotiff image in the JFrame
maven apache
apachemaven0 at gmail.com
Wed Apr 28 20:42:29 EST 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.maptools.org/pipermail/geotiff/attachments/20100429/a637f214/attachment.htm
More information about the Geotiff
mailing list