how to display a XImage with 16bits depth in a drawable with a depth of 24bits ?

hd h.dupont65 at
Fri Feb 27 02:47:15 PST 2009


I my app, I receive a raw image in 16 bits depth.
My defaut visual have a depth of 24 bits (and all other Visual have 24 
or 32bits depth on my X server).

To display the bitmap I try to create an XImage with XCreateImage() and 
display it with XPutImage().
But X displays a "bad match" error

If I try to display a "raw image" with the same depth (24bits) as the 
visual (24bits), my app works.

Question : XImage APIs (XCreateImage() / XPutImage() / ...) can convert 
'on the fly' the depth of the bitmap to match the visual depth
or must I convert myself the raw bitmap to match the visual depth ? 
(convert each pixel from 16bits to 24 bits)


More information about the xorg mailing list