-#else
- /* GetPixel() does also work for X11, but we use some optimization here */
- unsigned int pixel_value;
-
- if (bitmap == pix[PIX_BACK])
- {
- /* when reading pixel values from images, it is much faster to use
- client side images (XImage) than server side images (Pixmap) */
- static XImage *client_image = NULL;
-
- if (client_image == NULL) /* init image cache, if not existing */
- client_image = XGetImage(display, bitmap->drawable,
- 0,0, WIN_XSIZE,WIN_YSIZE, AllPlanes, ZPixmap);
-
- pixel_value = XGetPixel(client_image, x, y);
- }
- else
- {
- XImage *pixel_image;
-
- pixel_image = XGetImage(display, bitmap->drawable, x, y, 1, 1,
- AllPlanes, ZPixmap);
- pixel_value = XGetPixel(pixel_image, 0, 0);
-
- XDestroyImage(pixel_image);
- }
-
- return pixel_value;
-#endif