- {
- XImage *ximage;
- unsigned char *result, *o;
- unsigned char *bits = (unsigned char *) malloc (sizeof(bob_bits));
- int x, y;
- int scale = ((st->width > bob_width * 10) ? 2 : 1);
-
- memcpy (bits, bob_bits, sizeof(bob_bits));
- ximage = XCreateImage (st->dpy, st->visual, 1, XYBitmap, 0,
- (char *) bits, bob_width, bob_height, 8, 0);
- ximage->byte_order = LSBFirst;
- ximage->bitmap_bit_order = LSBFirst;
- *w = ximage->width * scale;
- *h = ximage->height * scale;
- o = result = (unsigned char *) malloc ((*w * scale) * (*h * scale));
- for (y = 0; y < *h; y++)
- for (x = 0; x < *w; x++)
- *o++ = (XGetPixel(ximage, x/scale, y/scale) ? 255 : 0);
-
- return result;
- }
- else /* load a bitmap file */
-#ifdef HAVE_JWXYZ
- abort(); /* #### fix me */
-#else
- {
- Pixmap pixmap =
- xpm_file_to_pixmap (st->dpy, st->window, bitmap_name, &st->width, &st->height, 0);
- XImage *image;
- int x, y;
- unsigned char *result, *o;
- XColor colors[256];
- Bool cmap_p = has_writable_cells (st->screen, st->visual);
+ image = image_data_to_ximage (st->dpy, st->visual,
+ bob_png, sizeof(bob_png));
+ else
+ image = file_to_ximage (st->dpy, st->visual, bitmap_name);