Based on the example in Graphics::Primitive, I came up with this:
use strict; use warnings; use Graphics::Primitive; use Graphics::Color::RGB; use Graphics::Primitive::Border; use Graphics::Primitive::Component; use Graphics::Primitive::Driver::Cairo; my $c = Graphics::Primitive::Component->new( background_color => Graphics::Color::RGB->new( red => 1, green => 0, blue => 0 ), width => 500, height => 350, border => new Graphics::Primitive::Border->new( width => 5 ) ); my $driver = Graphics::Primitive::Driver::Cairo->new(format => 'SVG'); $driver->prepare($c); $driver->finalize($c); $driver->draw($c); $driver->write('test.png');
and then went on to install the missing modules using cpan, specifically Graphics::Primitive and Graphics::Primitive::Driver::Cairo.
As a prerequisite, one has to install the cairo graphics library which I cannot do on my machine. Have you gone through this process?
In reply to Re: Simple Graphics::Primitive example?
by hdb
in thread Simple Graphics::Primitive example?
by djzort
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |