Another option is to use xwd and xwdtopnm utilities but it doesn't work the way it should.
However, there is a screenshot taking application Shutter, it also provides the capability of pointing at a window and taking its screenshot. Its written in Perl and I cannot read Perl code :)
It would be interesting to ask the developer of Shutter how it achieves this functionality.
Thanks :)
Another option is to use xwd and xwdtopnm utilities but it doesn't work the way it should.
However, there is a screenshot taking application Shutter, it also provides the capability of pointing at a window and taking its screenshot. Its written in Perl and I cannot read Perl code :)
It would be interesting to ask the developer of Shutter how it achieves this functionality.