On Fri, 2004-05-28 at 05:03, Mark McLoughlin wrote: > Uggh, why on earth is there no XShmGetSubImage() ? In the normal case, when you have SHM images, you also have SHM pixmaps, and a CopyArea/XSync pair has two big advantages over XShmGetImage() - It is automatically clipped to the screen bounds, rather than giving an X error if it goes outside the screen bounds. (Though this isn't an issue for you since you are getting from the root window) - It allows copying to a subarea of the SHM buffer. So, what we do in GTK+ is that we try to wrap every ShmImage we are getting into with a ShmPixmap; if that fails, we just forget about Shm; it's a rare case and local sockets are pretty fast anyways. The code is in gdk/x11/gdkimage-x11.c:_gdk_x11_copy_to_image() Or perhaps you could just use GdkImage and gdk_drawable_copy_to_image()? Regards, Owen
Attachment:
signature.asc
Description: This is a digitally signed message part