[vox-tech] reading bitmaps in XLib

Bill Kendrick vox-tech@lists.lugod.org
Fri, 17 Oct 2003 00:40:10 -0700


On Fri, Oct 17, 2003 at 04:20:06PM +1000, Julie Russell wrote:
> Hi again,
> 
> I am writing an application in C++ using Xine, XLib and the common C++
> library which is just a C++ wrapper for threads. I am trying to keep it as
> simple as possible, and not mix too many languages. I actually want to
> display a jpeg on an X window, so I thought if I could display a bitmap
> first, then look for some decompression code to convert the jpeg into a
> bitmap that would be the way to go. I am pretty new to X so I didn't realise
> that there was different bitmap formats, thanks for that.

Are you doing this to learn how to decode JPEGs?  Or do you just want to be
able to throw one up, and not worry about the technicalities? :^)

If the latter, then there are, of course, libs that'll handle JPEG decoding
for you, and which are Open Source (LGPL, I'm guessing).


Back in the day, when I was doing Xlib coding, putting up color bitmaps
was one of the more irritating and difficult things for me.  X-Window likes
to transparently support anything from two-bit graphics (black-n-white) to
256 color (paletted) to full-color.  Unfortunately, that ended up meaning
_I_ had to figure out what to do in the various situations.

This is why I like SDL (and if I bothered messing with them, all of the
other toolkits)... it handles it for me in the 'appropriate fashion,'
and I don't need to worry about it, for the most part.
(e.g., all of my games _should_ run fine on 256 color, 16bit, 24bit or 32bit
displays, and I didn't need to worry about the "how" part ;^) )


Your e-mail address (.au) makes me think you're not local :^)
If you ARE, though (as in, near Davis, CA), I believe LUGOD's library has
most of the excellent O'Reilly collection of X-Window programming books.
( http://www.lugod.org/library/ for details )


Good luck!  Keep the questions up... our lists have been too quiet lately
(okay, okay... they've just had little content _I'm_ interested in ;^) )


Late for bed,

-bill!

-- 
bill@newbreedsoftware.com                           Got kids?  Get Tux Paint! 
http://newbreedsoftware.com/bill/       http://newbreedsoftware.com/tuxpaint/