[cairo] Drawing to an X bitmap pixmap

Martin Pärtel lagitus at mbnet.fi
Fri Mar 4 06:59:49 PST 2005


Hello,

I'm trying to have cairo draw to an X bitmap (using the latest CVS 
version) like this:

//...
alpha_pixmap = XCreatePixmap(dpy, DefaultRootWindow(dpy),
	200, 100, 1);

alpha_surface = cairo_xlib_surface_create(
	dpy,
	alpha_pixmap,
	DefaultVisual(dpy, DefaultScreen(dpy)),
	CAIRO_FORMAT_A1,
	DefaultColormap(dpy, DefaultScreen(dpy))
	);
XSync(dpy, False); //Crash here

Error message:

X Error of failed request:  BadMatch (invalid parameter attributes)
   Major opcode of failed request:  154 (RENDER)
   Minor opcode of failed request:  4 (RenderCreatePicture)
   Serial number of failed request:  20
   Current serial number in output stream:  21



I tried opening a surface to draw directly onto window with 
CAIRO_FORMAT_RGB24 and that worked nicely.

What am I doing wrong?



More information about the cairo mailing list