Re: [gtk-list] Re: How do I get the color....



On 21 May, Des Herriott shouted:
->  On May 20, KC5TJA wrote:
->  > Can you give a more complete example of .xpm files?  I haven't a clue as
->  > to what they are, yet I see them mentioned every now and again.  Also, how
->  > are they used within a GTK application?  What functions need be called,
->  > etc?
->  
->  XPM is an image format, pretty much a de-facto standard for icons under
->  X these days.  It's a not a "standard" part of X per se, however it's
->  pretty ubiquitous.  Have a look in:
->  
->    ftp://avahi.inria.fr/pub/xpm
->  
->  for the sources and some good papers on the format.  It's well-documented.

and it's garbage. 
use png.
xpm is badly thought up as a format, and thus is ambiguous. I had to go
to enormous lengths to just be able to parse some xpm's becuase there
is a major ambiguity in the format conecrning whitespace.
Also the format doesnt lkimit the number of colros thus some aps (gimp)
will create xpm's with colrotabels of 1000's of entries that are a
nightmare to load (and to save too), libXpm wont load xpm's wiht mroe
than 256 colro entires - a lot of programs wont and will complain that
they are invalid xpm's. Imlib will try and load them, albeit slowly.

The ONLY use xpm has is to #include into source code and thus be
inlined. This is where its use should end. 

use another format - png is what I suggest. ppm is also viable as it's
just about the simples format to parse by hand and wirte your own
loaders and savers for, but it doesn't support transparency.

->  You'll also want to look at the Gtk tutorial, part 7.5.
->  

-- 
--------------- Codito, ergo sum - "I code, therefore I am" --------------------
raster@rasterman.com       /\___ /\ ___/||\___ ____/|/\___  raster@redhat.com
Carsten Haitzler           | _ //__\\ __||_ __\\ ___|| _ /  Red Hat Advanced
218/21 Conner Drive        || // __ \\_ \ | |   \ _/_|| /   Development Labs
Chapel Hill NC 27514 USA   ||\\\/  \//__/ |_|   /___/||\\   919 547 0012 ext 282
+1 (919) 929 9443, 801 4392   For pure Enlightenmenthttp://www.rasterman.com/ 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]