| From | Sent On | Attachments |
|---|---|---|
| mja...@union06.de | Jun 20, 2007 3:34 am | |
| jai-...@javadesktop.org | Jun 20, 2007 4:29 am | |
| jai-...@javadesktop.org | Jun 20, 2007 4:43 am | |
| Brian Burkhalter | Jun 20, 2007 11:34 am | |
| Brian Burkhalter | Jun 20, 2007 11:51 am | |
| jai-...@javadesktop.org | Jun 21, 2007 6:19 am | |
| jai-...@javadesktop.org | Jun 21, 2007 11:05 am |
| Subject: | Re: RE: [JAI-IMAGEIO] Problem rendering Tiff with 2 samples per pixel | |
|---|---|---|
| From: | Brian Burkhalter (Bria...@Sun.COM) | |
| Date: | Jun 20, 2007 11:34:32 am | |
| List: | net.java.dev.jai-imageio.interest | |
Frank,
Please send the file directly if you don't mind.
Brian
On Wed, 20 Jun 2007, jai-...@javadesktop.org wrote:
Hi,
thanks for yor interest. I use the following code, so just very basic, very
simple display of a TIFF.
Again, I can send you the file if that helps.
-- frank
package test.ImagePanel.DisplayJAI;
import java.awt.Rectangle; import java.awt.image.*; import java.awt.image.RenderedImage; import java.io.*; import java.util.Iterator;
import javax.imageio.*; import javax.imageio.stream.FileImageInputStream; import javax.swing.*;
import com.sun.media.jai.widget.DisplayJAI;
public class TestDisplayJAI {
private static RenderedImage image = null;
private static final String initialFile = new
String("../../../../src/test/ImagePanel/DisplayJAI/Palette02.tif");
public TestDisplayJAI() {
super();
}
private static BufferedImage getImage(String fileName) {
BufferedImage result = null;
Iterator<ImageReader> readers =
ImageIO.getImageReadersBySuffix(fileName.substring(fileName.lastIndexOf('.') +
1));
File f = new File(fileName);
try {
ImageReader reader = null;
while (readers.hasNext()) {
reader = readers.next(); reader.setInput(new FileImageInputStream(f)); try { result = reader.read(0); reader.dispose(); break;
} catch (RuntimeException e) { e.printStackTrace(); } }
} catch (IOException e) { } return result; }
public static void main(String[] args) { image = getImage(initialFile); JFrame aFrame = new JFrame(); DisplayJAI aCanvas = new DisplayJAI(image); aFrame.getContentPane().add( new JScrollPane(aCanvas) ); aFrame.setVisible(true); aFrame.setBounds(new Rectangle(100, 100, 400, 400)); aFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); aFrame.validate(); } } [Message sent by forum member 'fmorawietz' (fmorawietz)]
---------------- Brian Burkhalter Java Media, Imaging, and Graphics Sun Microsystems, Inc.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





