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