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


|