Posted by neian
on October 27, 2006 at 2:33 PM PDT
Hi, im just new to JAI and I'm having a problem displaying a tiff image with a Wang annotation. Actually, I was able to display the image but the annotation didnt appear in the JPanel.
Below is the code I used to display the image in a JPanel. I am using DisplayJAI which is in the JAI tutorial I found.
I tried looking for any topics regarding my problem but discussions of image with annotations are few.
Please help. Thanks.
ByteArraySeekableStream stream = null;
ImageBean imageBean = new TestJAI().retrieveImage("");
stream = new ByteArraySeekableStream(imageBean.getImageField()); //
PlanarImage image = JAI.create("stream", stream);
JFrame frame = new JFrame();
Container contentPane = frame.getContentPane();
// Create an instance of DisplayJAI.
DisplayJAI dj = new DisplayJAI(image);
frame.setSize(image.getWidth(),image.getHeight()); // adjust the frame size.
frame.setVisible(true); // show the frame.