Re: Capturing & Displaying Screen Images with XGetImage & XPutImage
Re: Capturing & Displaying Screen Images with XGetImage & XPutImage
- Subject: Re: Capturing & Displaying Screen Images with XGetImage & XPutImage
- From: "Dean N. Williams" <email@hidden>
- Date: Thu, 04 Mar 2004 05:42:43 -0800
- Organization: PCMDI
John and Sean:
Instead of specifying the root window ID, I used the drawable window
ID. By doing so, I had to set the start location to (0,0). The only
problem with solution is the positioning of the drawable window on the
rootless X server. That is, if the drawable window is too far to the
left and partially not visible, then a BadMatch error is the result.
XGetWindowAttributes doesn't detect the window's position in
relationship to the rootless screen when the drawable window is
partially not shown from the left. The X position value is always 0. I
would have expected it to be a negative number for the x start position
when too far to the left. Is there another function that will detect the
absolution position of the drawable window in relationship to the
rootless screen?
/* Create the image of the canvas */
ximage = XGetImage(display, drawable,
0, 0, width, height, XAllPlanes(), ZPixmap);
Thanks and best regards,
Dean
John Harper wrote:
Rootless X servers on Mac OS X typically don't have a root window, so
GetImage'ing from it returns undefined results. If what you want to do
is to fetch the contents of a window you created, try passing that
window id to GetImage instead of the root window,
One trick that some X11 applications use is doing an XGetImage of the root
window. Because of how XGetImage works on various platforms, the image
returned is that of the entire desktop, with all windows visible on top of
the root. Whether this is a side effect of how the frame buffer is
implemented on various platforms, or whether X11 is supposed to work this
way, I think a number of "screen scrape" programs may expect this behavior.
I can certainly see how it might not work with "rootless" X servers such as
XDarwin, X11.app, or MSWindows versions.
-Sean
__
email@hidden
925-422-1648
_______________________________________________
x11-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/x11-users
Do not post admin requests to the list. They will be ignored.
_______________________________________________
x11-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/x11-users
Do not post admin requests to the list. They will be ignored.