Re: simple(st) way to display any image?
Marteno Rodia wrote:
Hello,
I want to paint an image (GUI created using Swing) which is written in
a file having a proprietary format. I've written an apropriate
MyOwnFormatImgReader. Using it, I can access values of the image
samples directly.
Would that be an int[] of RGB values that can easily be used to populate
a BufferedImage?
I planned to use a JLabel (as a part of my JFrame) because. JLabels
can display Icons. I can create an ImageIcon from any Image. But how
to obtained an Image? I planned to create a BufferedImage instance and
set each pixel value using the setRgb(...) function.
OK.
Is it a good way to follow?
Simple, easy, works for me.
Will it work?
Sure.
Maybe there is a simpler way
to do that?
Don't think so.
What if I want to rescale the displayed image using the
BufferedImage.getScaledInstance() ??
OK.
--
Knute Johnson
email s/nospam/knute2009/
--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access