- assert(wi);
-
- int w = wi->width(), h = wi->height();
- Pixmap p = XCreatePixmap(**display, wi->window(), w, h, _screen->depth());
- XImage *im = XCreateImage(**display, _screen->visual(), _screen->depth(),
- ZPixmap, 0, NULL, w, h, 32, 0);
-
- unsigned char *data = new unsigned char[im->bytes_per_line * h];
- unsigned char *dp = data;
-
- for (int y = 0; y < h/3; ++y)
- for (int x = 0; x < w; ++x, dp += im->bits_per_pixel/8)
- renderPixel(im, dp, _red_color_table[255*x/w] << _red_offset);
- for (int y = 0; y < h/3; ++y)
- for (int x = 0; x < w; ++x, dp += im->bits_per_pixel/8)
- renderPixel(im, dp, _green_color_table[255*x/w] << _green_offset);
- for (int y = 0; y < h/3; ++y)
- for (int x = 0; x < w; ++x, dp += im->bits_per_pixel/8)
- renderPixel(im, dp, _blue_color_table[255*x/w] << _blue_offset);
-
- printf("\nDone %d %d\n", im->bytes_per_line * h, dp - data);
-
- im->data = (char*) data;
-
- XPutImage(**display, p, DefaultGC(**display, _screen->screen()),
- im, 0, 0, 0, 0, w, h);