in reply to Screenshots from URL's
If you are running linux, this will do it, but there are some little tricks you need to be careful of, like finding the window id of the browser, and making sure you are on the same virtual desktop as the browser when running this script. This is not a polished/finished script, it just shows you the steps needed to do it.
#!/usr/bin/perl use warnings; use strict; use Image::Magick; #must be on same virtual desktop as the browser #assume browser's xwindow id = 0xa00022 #use xwininfo to find it #xwininfo -name Mozilla #my $blob = `import -window 0xa00022 jpg: - `; sleep 5; #allows you time to minimize this script #else it will be on top #works my $blob = `import -window 0xa00022 jpg:`; # the x: stuff dosn't seem to work #my $blob = `import x: 0xa00022 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
|
|---|