in reply to Simple Graphics::Primitive example?
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Simple Graphics::Primitive example?
by kcott (Archbishop) on Feb 25, 2014 at 08:08 UTC | |
by hdb (Monsignor) on Feb 25, 2014 at 08:46 UTC | |
|
Re^2: Simple Graphics::Primitive example?
by djzort (Sexton) on Feb 25, 2014 at 22:39 UTC | |
by tangent (Parson) on Feb 25, 2014 at 23:30 UTC | |
by djzort (Sexton) on Feb 26, 2014 at 22:54 UTC |