Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Programmer > Re: Image Displ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 7 of 8 Topic 52593 of 55513
Post > Topic >>

Re: Image Displayer

by "John B. Matthews" <nospam@[EMAIL PROTECTED] > May 9, 2008 at 11:14 PM

In article 
<76f67313-1255-4056-b072-8dc634fa0c42@[EMAIL PROTECTED]
>,
 Chase Preuninger <chasepreuninger@[EMAIL PROTECTED]
> wrote:

> I want to figure out how to read a JPG file by just using the read
> method in the InputStream class then I want to create a GUI component
> that can display it.
> 
> 1) How are the bytes formatted in a JPG file?
> 2) What is the best way to color individual pixels in a JComponent.
> 
> [elided]

Just to get started, use one of the ImageIO.read() methods to get your 
image into a BufferedImage. Then call getRaster() and have fun with the 
raster's numerous setXXX methods. Then override paintComponent() in 
whatever Component you extend:

protected void paintComponent(Graphics g) {
    g.drawImage(bufferedImage, 0, 0, this);
}

John
-- 
John B. Matthews
trashgod at gmail dot com
home dot woh dot rr dot com slash jbmatthews
 




 8 Posts in Topic:
Image Displayer
Chase Preuninger <chas  2008-05-08 13:30:10 
Re: Image Displayer
mekane <mekane8@[EMAIL  2008-05-08 15:36:15 
Re: Image Displayer
Chase Preuninger <chas  2008-05-08 14:00:35 
Re: Image Displayer
Lew <lew@[EMAIL PROTEC  2008-05-08 19:29:24 
Re: Image Displayer
Lew <lew@[EMAIL PROTEC  2008-05-08 19:30:43 
Re: Image Displayer
Philipp <sicsicsic@[EM  2008-05-09 14:41:19 
Re: Image Displayer
"John B. Matthews&qu  2008-05-09 23:14:34 
Re: Image Displayer
Roedy Green <see_websi  2008-05-10 08:03:18 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Dec 3 17:27:16 CST 2008.