Noyoudont
Noyoudont

Reputation: 155

How do I programatically take a screenshot of an application in Linux?

How do I programatically take a screenshot of an application in Linux? I'm using c++. Any idea? For windows there are a lot of resources but I can't find anything for linux

Any help? Thanks

Upvotes: 7

Views: 7998

Answers (3)

Reputation:

Can't you just do this with http://www.imagemagick.org/script/index.php ?

It's usually onboard the linux repos, and you can do a lot more than just take a screen shot with it... http://tips.webdesign10.com/how-to-take-a-screenshot-on-ubuntu-linux

Upvotes: -1

ChristopheD
ChristopheD

Reputation: 116207

Already answered here:

Screenshot of a windows application running under wine (linux)

Edit: if you want to do it in C, try Xlib. Some links:

Upvotes: 2

Zifre
Zifre

Reputation: 26998

If you just want a screen recorder, try using xvidcap. If you want to make your own, try looking at the sources. I'm not really sure how it works though. My guess is that it uses the XShm extension somehow.

Upvotes: 1

Related Questions