How does screenshot work in an OS running Xorg

Alexandre CONFIANT-LATOUR cmwachoukette at gmail.com
Wed Mar 12 01:27:58 PDT 2014


On 11/03/2014 21:06, Hongze Zhao wrote:
> Hi List,
> 
> I am curious about how screenshot  in an OS running Xorg works? I guess Linux does not provide such
> a system call or interface. Is screenshot implemented by calling a special xorg interface?

I use XLib function XGetImage <http://tronche.com/gui/x/xlib/graphics/XGetImage.html>.
It performs a raw dump of a drawable (a Window or a Pixmap). But you must convert the data into a
high level image format (png, jpg) using an external lib.

>From the X.Org inner (DDX, Module, ...) You can also call this function through the ScreenRec structure.

-- 
Alexandre Confiant-Latour
@         : alex at user-unfriendly.net
Jabber    : choukette at im.apinc.org
GPG Key ID: 0x18CA62CC (pgp.mit.edu)



More information about the xorg mailing list