How does screenshot work in an OS running Xorg

Alexandre CONFIANT-LATOUR cmwachoukette at
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 <>.
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
Jabber    : choukette at
GPG Key ID: 0x18CA62CC (

More information about the xorg mailing list