Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Perl Modules

    GD::Arrow 0.01

    Download button

    No screenshots available
    Downloads: 274  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Todd Caine | More programs
    Perl Artistic License / FREE
    January 6th, 2010, 20:43 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    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);



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    draw arrow | Perl module | GD::Polygon subclass | GD | arrow | drawing

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM