[cairo] Xlib and XCopyArea

Olivier Jolet olivier.jolet at skynet.be
Fri Feb 9 01:41:10 PST 2007


Hi,
 
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);
  XMapWindow(dpy, window);
  
  drawable = XCreatePixmap (dpy, rootwin, SIZEX, SIZEY, DefaultDepth
(dpy, screen));
  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...
URL: http://lists.freedesktop.org/archives/cairo/attachments/20070209/c08173f4/attachment-0001.html


More information about the cairo mailing list