in reply to Capture opengl screen

You can probably use Image Magick's import to capture the screen. Here is a test script you can play with.... it captures mozilla, just change the names to suit your needs.
#!/usr/bin/perl use warnings; use strict; use Image::Magick; use X11::WMCtrl; use Data::Dumper; my $wmctrl = X11::WMCtrl->new; printf("window manager is %s\n", $wmctrl->get_window_manager->{name}); my @windows = $wmctrl->get_windows; my $wid; # x window id my $host; # virtual desktop foreach my $app(@windows){ my $title = $app->{title}; if( $title =~ /Mozilla/i){ print "$title\n"; print Dumper(\$app),"\n\n"; $wid = $app->{id}; $host = $app->{host}; } } $wmctrl->switch($host); #must be on same virtual desktop as the browser #works my $blob = `import -window $wid jpg:`; #my $blob = `import -`; #postscript produced #print "$blob\n"; # now $blob is in memory and you can do what you # want with it. my $output = Image::Magick->new(magick=>'jpg'); $output->BlobToImage( $blob ); $output->Resize(geometry=>'160x120'); $output->Write( $0.'.jpg'); exit; # png works too

I'm not really a human, but I play one on earth. Cogito ergo sum a bum

Replies are listed 'Best First'.
Re: Capture opengl screen
by iea (Beadle) on Mar 29, 2008 at 19:33 UTC
    well i tried both solutions thank you very much ... but i keep on getting a black screen. I tried image magick bevor. I am using activestate perl under windows and i would be really happy if anybody has any solution to create screenshots of full screen directx games / applications. I tried many ways but i keep on getting black screens thanks

      Err - DirectX is quite different from OpenGL.

        so itīs not possible ? I thought grabing the front/back buffer is possible in OpenGL and DirectX