in reply to Tk Screen and Canvas Screenshots

I'm using this and it works great. Thanks! However, it only captures the part of the Canvas that is currently displayed. If I've drawn outside that area and expanded the Canvas such that I need to use the scrollbars in order to see the full image, how can I get a capture of the full scrollable image and not just the currently displayed portion? Thanks.

Replies are listed 'Best First'.
Re^2: Tk Screen and Canvas Screenshots
by zentara (Cardinal) on Mar 13, 2008 at 18:33 UTC
    Use tha bbox('all') and the postscript capture, then convert it to whatever you want.
    $mw->Button( -text => "Save PS", -command => [sub { $canv->update; my @capture=(); my ($x0,$y0,$x1,$y1)=$canv->bbox('all'); print "$x0,$y0,$x1,$y1\n"; @capture=('-x'=>$x0,'-y'=>$y0,-height=>$y1-$y0,-width=>$x1-$x +0); $canv->postscript(-colormode=>'color', -file=> "$0.ps", -rotate=>0, -width=>2400, -height=>3400, @capture); system("convert $0.ps $0.png"); } ] )->pack;

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