Hello, Xperts. I want to draw an image that I have in ARGB8888 format to an X Window. The obvious way to do this is to convert my image to an XImage and use XPutImage (or XShmPutImage when that is available).
First, I need to select an appropriate Visual for my Window. I get BadMatch errors for X_CreateWindow whenever I try to use a Visual other than the default visual. Is this true for all X servers, and should I assume that the default visual is the only one I can use for Windows? Or is there some other way to find out which visuals reported are supported for the screen? Second, I need a Visual in XCreateImage. Apparently, after testing, this has to be the same as the Visual of the Window. Third, bits per pixel is not advertised by the visual but can be inferred by creating an image with XCreateImage and checking the bits_per_pixel field. In the source to XCreateImage, _XGetBitsPerPixel is called and returns 32 for both 24 and 32 bit deep visuals. Then, in XPutImage, if the image->bits_per_pixel and dpy->pixmap_format[x]->bits_per_pixel do not match, a temporary XImage is created and filled with XGetPixel and XPutPixel calls... wouldn't this be a real performance killer on 24-bit displays? Is the correct way to find a pixmap_format with XListPixmapFormats with the same depth as the default visual and just use this? Are the red/green/blue_masks specified in the word order of the X server, and as such be swapped if client and server have different byte orders? Finally, what the hell is a DirectColor visual? I understand PseudoColor and TrueColor, but DirectColor? When are they used? Why? How would I go about using one? I used to think X was nice; now I'm not so convinced anymore... Tor _______________________________________________ Xpert mailing list [EMAIL PROTECTED] http://XFree86.Org/mailman/listinfo/xpert
