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 / December 2003

Tip: Looking for answers? Try searching our database.

Handling a xpm file

Thread view: 
Juan - 06 Dec 2003 03:15 GMT
Hi

I am beginning with java and I need to handle a xpm format file in
order to put that file pixel by pixel in a frame using only awt lib.
How could I do that??
How can i handle any graphic file?

Thanks in advance

Juan
Harald Hein - 06 Dec 2003 07:02 GMT
> I am beginning with java and I need to handle a xpm format file in
> order to put that file pixel by pixel in a frame using only awt lib.
> How could I do that??

xpm files are ASCII text. In fact, they are small pieces of C data
structure definitions, originally intended for inclusion into X11
programs.

If you have a look at one file, the data structure is very obvious, and
it is a straight forward task to write a parser to read them. If you
want to work a little bit more thoroughly (there are three main
variants of the format), get the format definition
(http://koala.ilog.fr/ftp/pub/xpm/xpm-doc-A4.PS.gz), and implement
according to the definition.

> How can i handle any graphic file?

Start by reading the GUI and 2D tutorials on Sun's web site. Pointers
are posted here daily.
Marco Schmidt - 06 Dec 2003 20:46 GMT
Juan:

>I am beginning with java and I need to handle a xpm format file in
>order to put that file pixel by pixel in a frame using only awt lib.
>How could I do that??

Try if Toolkit can load xpm, e.g. with this test program:
<http://www.geocities.com/marcoschmidt.geo/java-load-image-toolkit.html>.

>How can i handle any graphic file?

You can't. If what you are looking for is not supported by Toolkit or
ImageIO you'll have to look for 3rd party libraries for each format
which you want to support. There is no single way to handle every
format, there are just too many of them. I have a list of libraries at
<http://www.geocities.com/marcoschmidt.geo/java-image-coding.html>.

Regards,
Marco
Signature

Please reply in the newsgroup, not by email!
Java programming tips: http://jiu.sourceforge.net/javatips.html
Other Java pages: http://www.geocities.com/marcoschmidt.geo/java.html



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



©2009 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.