3

does anyone know what is XLib ZPixmap format for 32/24bit images/pixmaps. Is it RGB(A) or BGR(A), etc. or highly implementation dependent?

1 Answers1

4

Pixmaps have no color, period. They're just arrays of pixel values. The only drawables in X that have a color interpretation are Windows (channels defined by Visuals), Pictures (channels defined by Picture Formats), and GLX drawables (channels defined by either a GLX visual or an fbconfig). Any "color" interpretation you want to put on a pixmap is a function of where those pixels are going to end up (or, where they came from). If you're going to put them into a Window, look at the Visual of the Window to discover what the color channel masks are.

[edit: added GLX drawable info]

ajax
  • 476
  • 3
  • 9
  • 1
    This is a great answer. I had the same question. Would you be able to post some Xlib sample code? – nonot1 Sep 23 '11 at 12:17