Subject: | Image noX11 drawing |
Date: | Sat, 15 Jan 2011 03:10:43 +1100 |
To: | bug-Prima [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
With recent debian packaged Prima 1.28 the docs of Prima::Image invite
Prima::noX11, but it seems drawing operations don't work in that case.
The program below makes an all-black /tmp/foo.png where I expected white
with a green square, which can be had by removing the Prima::noX11. Are
there limits on what Prima::Image can do without a server?
use strict;
use warnings;
use Prima::noX11;
use Prima;
my $image = Prima::Image->create (width => 100,
height => 100);
$image->begin_paint;
$image->color (cl::White);
$image->bar (0,0, 99,99); # background
$image->color (cl::Green);
$image->bar(10,10,30,30);
$image->end_paint;
$image->save('/tmp/foo.png') or die "Error saving:$@\n";
system "zgv -z /tmp/foo.png";
exit 0;