- memset (pXImage, 0, sizeof(*pXImage));
- pXImage->width = XWinAttribs.width; /* Width of image */
- pXImage->height = XWinAttribs.height; /* Height of image */
- pXImage->format = ZPixmap; /* XYBitmap, XYPixmap, ZPixmap */
-
- /* Pointer to image data */
- pXImage->byte_order = ImageByteOrder(pDisplay);
- pXImage->bitmap_unit = BitmapUnit(pDisplay);
- pXImage->bitmap_bit_order = BitmapBitOrder(pDisplay);
- pXImage->bitmap_pad = BitmapPad(pDisplay);
- pXImage->depth = XWinAttribs.depth;
- pXImage->bytes_per_line = 0; /* Accelerator to next line */
- pXImage->bits_per_pixel = bpp;
- XInitImage( pXImage );
- pXImage->data = calloc(pXImage->bytes_per_line, pXImage->height);
+ *pXImage = XCreateImage(pDisplay, XWinAttribs.visual,
+ XWinAttribs.depth,
+ ZPixmap, 0, NULL,
+ XWinAttribs.width, XWinAttribs.height,
+ BitmapPad(pDisplay), 0);
+ (*pXImage)->data = calloc((*pXImage)->bytes_per_line,
+ (*pXImage)->height);