You are not logged in.
Is there some somewhat easy way to get a screenshot of my desktop in c++ trough some library or so?
Or am i better of just calling some external program which will take care of that? if so which one would be good? (Screenshots should be saved as .bmp or high quality png with a filename of my choice)
I dont need the actual image inside my program, i just want to take screenshots at a certain time and have them saved with a specific file name.
Last edited by Envil (2009-01-14 23:04:03)
Offline
you can use imagemagick's import command:
import -window root screenshot.png
or look at it's source code and do it in c/c++
Offline
Can't you just use scrot+cron or something? You'd get to not program in C++, anyway.
Offline
Doing it with cron wouldnt be good since the c++ program performs certain steps, when its done with those i want the screenshot taken and this doesnt always happen at exactly the same times so its better to trigger it from the program.
Offline
I'm sure if you play with it you could make it function in much less code. I'm actually glad I found this myself, I hope you can use it.
Offline
Just exec to scrot or similar at the end of your program. Time to implement: 02 seconds.
archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson
Offline
I also recommend the 'import' command. I use it all the time for everyday screenshots. It can save into perfect quality .png. I have never used scrot.
Last edited by linkmaster03 (2009-01-14 21:40:56)
Offline
Gonna go with exec'ing import, ty all ^^
Offline