File: starpath.cgi

package info (click to toggle)
libsvg-perl 2.87-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 464 kB
  • sloc: perl: 2,789; makefile: 2
file content (25 lines) | stat: -rwxr-xr-x 565 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/perl -w

BEGIN {
  push @INC , '../';  
  push @INC , '../SVG';
}

use strict;
use SVG;


my $svg  = SVG->new();

my $def  = $svg->defs( id => 'myStar' );

my $r_star_path = $svg->get_path(type=>'path',x=>[-0.951,0.951,-0.588,0.000,0.588],y=>[-0.309,-0.309,-0.809,-1.000,0.809],-closed=>1);

my $star = $def->path('transform' => "scale(100, 100)",%$r_star_path,);

$svg->use(-href => "#myStar", stroke=>"red",fill => "yellow", transform => "translate(200, 200)" );

print "Content-Type: image/svg+xml\n\n";

print $svg->xmlify;