How do I use an X11 Pixmap in a GtkImage?
adlo <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <[email protected]> |
I posted this message under the wrong thread title, so I am duplicating it here for clarity.
I have managed to resolve these issues using cairo_xlib_surface_create_with_xrender_format. It would seem that the bit depth of the widget doesn't matter. The only thing that matters is that the Cairo surface has the same bit depth as the window's X11 Pixmap.
So, the code would be something like this:
XWindowAttributes attr;
XRenderPictFormat *format;
cairo_surface_t *surface;
XGetWindowAttributes (dpy, xid, &attr);
format = XRenderFindVisualFormat (dpy, attr.visual);
surface = cairo_xlib_surface_create_with_xrender_format
(dpy, pixmap, attr.screen, format, attr.width, attr.height);
Regards
adlo
--
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo