[comp.windows.x] Difference between XSetWindowBackgroundPixmap and XPutImage

kwh@sei.cmu.edu (Kurt Hoyt) (04/29/88)

What is different between drawing pixmaps using these methods:

Method 1 --
	XReadBitmapFile
	XCreatePixmap
	XCopyPlane /* Turn depth 1 pixmap into window depth pixmap */
	XSetWindowBackgroundPixmap
	...
	XMapWindow
	...
	XClearWindow /* In event handler for Expose */
	...

Method 2 --
	/* Use XReadBitmapFile guts to get the char array data. */
	image = XCreateImage (display, NULL, 1, XYBitmap, 0, data,
		              width, height, 8, (width + 7) / 8);
	image->byte_order = LSBFirst;
	image->bitmap_unit = 8;
	image->bitmap_bit_order = LSBFirst;
	...
	XMapWindow
	...
	XPutImage (d, w, gc, image, 0, 0, 0, 0, image->width, image->height);
	/* Above in event handler for Expose */
	...

It would seem that drawing pixmaps is to be done using images, since there
are image drawing calls in Xlib, but no pixmap drawing calls. However,
programs which are identical except for the pixmap drawing mathod give
different results. XSetWindowBackgroundPixmap seem pretty reliable for
drawing pixmaps, but it will tile the pixmap. XPutImage puts up scrambled
images in some cases, but using the same bytes for the data. What's up? Is
it me or a bug? If a bug, I have the small programs and bitmaps to send to
MIT.

-- 
Kurt Hoyt, Software Engineering Institute -- kwh@sei.cmu.edu
"From previous research with rendering systems we have learned that a good
dose of gratuitous partial differential equations is needed to meet the
paper quota for impressive formulas." SIGGRAPH '87 Proceedings, p. 73