[cairo] Xlib and XCopyArea
olivier.jolet at skynet.be
Fri Feb 9 01:41:10 PST 2007
I'm a new user of Cairo. I can draw and display directly into the
drawable created by XcreateSimpleWindow; but now, I'm trying to draw
into a Pixmap with XcreatePixmap and then display it in the window...
Sorry, It is probably ridiculus for most of you. but I don't understand.
gc = XDefaultGCOfScreen(DefaultScreenOfDisplay(dpy));
window = XCreateSimpleWindow (dpy, rootwin, posX, posY, SIZEX, SIZEY,
0, BlackPixel(dpy, screen), BlackPixel(dpy, screen));
XStoreName(dpy, window, "Hello");
XSelectInput(dpy, window, ExposureMask|ButtonPressMask);
drawable = XCreatePixmap (dpy, rootwin, SIZEX, SIZEY, DefaultDepth
surface = cairo_xlib_surface_create (dpy, drawable, DefaultVisual
(dpy, screen), SIZEX, SIZEY);
cairo_xlib_surface_set_size (surface, SIZEX, SIZEY);
paint(surface); /* just draw un circle *
XCopyArea(dpy, drawable, window, gc, 0, 0, SIZEX, SIZEY, 0, 0);
Am I wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cairo