GD::ArrowDraw arrows using GD | |
Download |
GD::Arrow Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Todd Caine
- Publisher web site:
- http://search.cpan.org/~tcaine/
GD::Arrow Tags
GD::Arrow Description
Draw arrows using GD GD::Arrow is a Perl subclass of GD::Polygon used to draw an arrow between two vertices.SYNOPSIS use GD; use GD::Arrow; my $width = 8; my ($x1, $y1) = (100, 10); my ($x2, $y2) = (100, 190); my ($x3, $y3) = (10, 30); my ($x4, $y4) = (190, 75); my $arrow = GD::Arrow::Full->new( -X1 => $x1, -Y1 => $y1, -X2 => $x2, -Y2 => $y2, -WIDTH => $width, ); my $image = GD::Image->new(200, 200); my $white = $image->colorAllocate(255, 255, 255); my $black = $image->colorAllocate(0, 0, 0); my $blue = $image->colorAllocate(0, 0, 255); my $yellow = $image->colorAllocate(255, 255, 0); $image->transparent($white); $image->filledPolygon($arrow,$blue); $image->polygon($arrow,$black); my $half_arrow_1 = GD::Arrow::LeftHalf->new( -X1 => $x3, -Y1 => $y3, -X2 => $x4, -Y2 => $y4, -WIDTH => $width, ); my $half_arrow_2 = GD::Arrow::LeftHalf->new( -X1 => $x4, -Y1 => $y4, -X2 => $x3, -Y2 => $y3, -WIDTH => $width ); $image->filledPolygon($half_arrow_1,$blue); $image->polygon($half_arrow_1,$black); $image->filledPolygon($half_arrow_2,$yellow); $image->polygon($half_arrow_2,$black); open IMAGE, "> image.png" or die $!; binmode(IMAGE, ":raw"); print IMAGE $image->png; close IMAGE; exit(0); Requirements: · Perl
GD::Arrow Related Software