Hi there,
i know this question was discussed on some topics before, but up to now i didn't get a really satisfying solution for that kind of problem.
I need to convert the
graphic contents of my canvases to any image format, preferrably
GIF or PNG. I tried out most of the different ways like described on perlmonks or anywhere else. The two solutions i found up to now are:
1. Using the canvas->
postscript method, which didn't satisfy me at all because of the loss of quality, especially regarding the fonts, font sizes, etc.; Also the need of some external convertion of the PS to GIF by "convert" for instance seems to me not much more than a workaround.
2. The other - apparent ideal - way is to use
WinPhoto. But that comes with two major troubles: The first is, that on my Linux-System WinPhoto is thery
time consuming (at least 5 secs for the ->Photo method) when storing the canvas content into an image. The other, much bigger problem is, that WinPhoto isn't available on
MSWindows systems, is it? And my customer runs the scripts on MSWindows, no chance to convince him to Linux ;-)
Is there really no other way than these two options to save a canvas to a GIF-image? Maybe someone knows a way, how to speed up WinPhoto and use it on MSWindows systems.
Thx in advance,
Markus.
The code i'm using is:
use Tk::WinPhoto;
my $imgsheet = $canwellsketch->Photo(
-format => 'Window',
-data => oct( $canwellsketch->id ),
);
$imgsheet->write(
"screenshot.gif",
-format => 'GIF'
);
or
$canwellsketch->postscript(
-file => "test.ps",
-x => ( $canwellsketch->bbox( "all" ) )[0],
-y => ( $canwellsketch->bbox( "all" ) )[1],
-width => 600,
-height => 400,
-pagewidth => 600,
);