Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Take screenshot of my window

Status
Not open for further replies.

JustBeginer

Programmer
Mar 13, 2003
39
Hi Friends,
I've wrote a simple program for 3D graphic.
I want to take a screenshot of the window where my objects are shown.I've tried to do that, but...
I take the screenshot from the upper left corner on the main screen.
Thanks a lot for the heplp in advance.
//--------------------------------------------------
void save_snap (){
GdkDrawable *root;
GdkWindow *parent;
root = gdk_get_default_root_window ();
pixbuf = gdk_pixbuf_get_from_drawable (NULL, root, NULL, 0,0 0, 0, (GLint)area->allocation.width,(GLint)area->allocation.height);
//save to file ...
}
//--------------------------------------------------
 
If you have ImageMagick, you can just do this
from a command line (or script)

xwd -root | convert - screenshot.jpg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top