Skip to main content

Display image from BufferedImage

1 reply [Last post]
shihabkb
Offline
Joined: 2008-12-31
Points: 0

Dear friends,

I am creating a DICOM Viewer. Currently I am using Image, ImageIcon for displaying my image from dicom file. Please check my below code.

sourceImage = new SourceImage(attrList);
ImageIcon icon = null;
Image img = null;
BufferedImage buffImg = sourceImage.getBufferedImage();
img = buffImg;
icon = new ImageIcon(img);
JPanel imagePanel = new JPanel();
JLabel lbl = new JLabel(icon);

Now I want to display the image using JAI. Is it possible? I can get BufferedImage from sourceImage.getBufferedImage(); API. Using BufferedImage is it possible to display the image by using JAI apis? Please help.

Thanks and Regards
Shihab

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Bob Deen

JAI per se has no display capability... it's designed as a processing
package, not a display package. There is a deprecated display class,
but it's not very good.

You might look at JadeDisplay:

http://www.openchannelfoundation.org/projects/JadeDisplay

which is a display component designed to work with JAI images. Note
that BufferedImage is not as efficient as RenderedImage or PlanarImage
because the entire image is in one tile... RI or PI images may be tiled,
which can greatly enhance performance. There are simpler display
solutions if you really just have a BufferedImage, but JD will work in
that case too.

(yeah it's a plug for my code, but it's open source now and I don't get
anything from it.....)

-Bob

jai-imageio@javadesktop.org wrote:
> Dear friends,
>
> I am creating a DICOM Viewer. Currently I am using Image, ImageIcon for displaying my image from dicom file. Please check my below code.
>
> sourceImage = new SourceImage(attrList);
> ImageIcon icon = null;
> Image img = null;
> BufferedImage buffImg = sourceImage.getBufferedImage();
> img = buffImg;
> icon = new ImageIcon(img);
> JPanel imagePanel = new JPanel();
> JLabel lbl = new JLabel(icon);
>

>
> Now I want to display the image using JAI. Is it possible? I can get BufferedImage from sourceImage.getBufferedImage(); API. Using BufferedImage is it possible to display the image by using JAI apis? Please help.
>
> Thanks and Regards
> Shihab
> [Message sent by forum member 'shihabkb' (shihabkb)]
>
> http://forums.java.net/jive/thread.jspa?messageID=327754
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net