XWindows - how capture window ?

XWindows - how capture window ?

ik idokan at gmail.com
Sun Feb 21 22:25:00 IST 2010


If you know the exact position and dimension of the window, it's really easy
to capture it.

There are two ways to capture a window:
1. access it's canvas
2. capture a rectangle in the exact position of the window

It takes about 5 minutes to write such progem when I use Lazarus, you do not
even need to create a visual application for it.

Ido

On Sat, Feb 20, 2010 at 22:13, Valery Reznic <valery_reznic at yahoo.com>wrote:

> Hi all.
>
> I faced following problem:
> I have X-Windows application. It has a lot of different functions and
> buttons.
>
> When one of those buttons is pressed applications open a window
> This window has a lot of different widgets inside (labels, pixmaps,
> buttons, etc)
>
> I need to capture this windows and save it content to the file.
> It's not that hard - xgrabsc program do all the work.
>
> But what is hard (at least hard for me :) is to capture content of this
> window, without it appearing on the screen.
>
> I have source of this application, and can change it as I like.
> The trouble is unless windows actually appears on the screen, xserver don't
> bother to draw it.
>
> My screen is 640x480 I tried to create window with offset 641 and 481 - i.e
> off screen. It doesn't work. I.e window created and grabbed by xgrabsc, but
> it's content is garbage.
> When offse is 400and 400 then part of the window appears on the screen and
> part not.
> After grabbing this window I saw, that part that appears on screen looks
> OK, but other part is garbage.
>
> I also tried to use XComoposite extension - without any success.
>
> Application is very, very ancient. It was written withusing Xlib functions
> and Xt toolkit - hardly more.
>
> Also application uses XSHM extension, i.e solution don't have be
> "network-aware" - anyway this application doomed to work only locally by
> this extension.
>
> I by no mean X expert, may be I missed something obvious with XComposite
> or just missed something
>
> Do you have any ideas, how can I render this window off screen and capture
> it's content ?
>
> Valery.
>
>
>
>
> _______________________________________________
> Linux-il mailing list
> Linux-il at cs.huji.ac.il
> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20100221/16bca3e1/attachment.html>


More information about the Linux-il mailing list