Zoo tutorials: [ SQL | Linux | XML ]
ProgZoo: [ Java | C# | VB | C++ | Perl ]
Log in

A Gentle Introduction to
Perl Programming

Tutorial: Drawing lines.

 
$g.line(60,20,60,100,$black) draws a line from (60,20) to (60,100) using the color $black.

We can control the thickness of the line and the end-cap.

The cap determines what happens at the end of a line.

1. Thickness and CAP style


Big

We draw three thick black lines. Each has thickness 15.

  • Square end cap
  • Butt end cap
  • Round end cap
The thin red lines are the same length.

three rectangles It seems that gd does not support end caps. Please inform ajcumming@gmail.com if you know different.