Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / May 2008

Tip: Looking for answers? Try searching our database.

Image Displayer

Thread view: 
Chase Preuninger - 08 May 2008 21:30 GMT
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.

Please don't tell me to just use ImageIO and to draw it using a
Graphics object because I know how to do that.
mekane - 08 May 2008 21:36 GMT
> 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?

Have you Googled for the JPEG spec?

> 2) What is the best way to color individual pixels in a JComponent.
>
> Please don't tell me to just use ImageIO and to draw it using a
> Graphics object because I know how to do that.

If I were you I would use the ImagIO packa-- oh, yeah, never mind. Good
luck with your project.
Chase Preuninger - 08 May 2008 22:00 GMT
I'm just intrested in seeing if I can do it.
Lew - 09 May 2008 00:29 GMT
> I'm just intrested in seeing if I can do it.

Besides the excellent advice already proffered of looking up the JPEG file
layout online, I suggest that you only need to post to one newsgroup,
especially given the huge overlap in readership among the three to which you
cross-posted.  While cross-posting is better than multi-posting, it is at best
tolerated and at best not helpful to the poster.  It's really sufficient to
ask your question once in these groups.

If you really must demean your message and diminish your standing by
cross-posting, it helps to set follow-up (f-u) to a single newsgroup, as here
with clj.help.

<http://www.jpeg.org/jpeg/index.html>
<http://en.wikipedia.org/wiki/JPEG>

GIYF.
WIYF.

Signature

Lew

Lew - 09 May 2008 00:30 GMT
Chase Preuninger wrote:
>> I'm just intrested in seeing if I can do it.

Besides the excellent advice already proffered of looking up the JPEG file
layout online, I suggest that you only need to post to one newsgroup,
especially given the huge overlap in readership among the three to which you
cross-posted.  While cross-posting is better than multi-posting, it is at best
tolerated and at best not helpful to the poster.  It's really sufficient to
ask your question once in these groups.

If you really must demean your message and diminish your standing by
cross-posting, it helps to set follow-up (f-u) to a single newsgroup, as here
with clj.help.

<http://www.jpeg.org/jpeg/index.html>
<http://en.wikipedia.org/wiki/JPEG>

GIYF.
WIYF.

Signature

Lew

Philipp - 09 May 2008 13:41 GMT
> 1) How are the bytes formatted in a JPG file?

In case you are also interested in other formats, see this very useful page:
http://www.martinreddy.net/gfx/2d-hi.html

HTH Phil
John B. Matthews - 10 May 2008 04:14 GMT
In article
<76f67313-1255-4056-b072-8dc634fa0c42@c65g2000hsa.googlegroups.com>,

> 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
[quoted text clipped - 4 lines]
>
> [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
Signature

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

Roedy Green - 10 May 2008 09:03 GMT
On Thu, 8 May 2008 13:30:10 -0700 (PDT), Chase Preuninger
<chasepreuninger@gmail.com> wrote, quoted or indirectly quoted someone
who said :

>1) How are the bytes formatted in a JPG file?

See http://mindprod.com/jgloss/jpg.html
http://mindprod.com/jgloss/gif.html
and follow the links.

If all you want is size info quickly, download
http://mindprod.com/products1.html#COMMON11
and look at ImageInfo

If you just want to mess around at a low level, tackle GIF or PNG
first. They are much simpler formats.
Signature


Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.