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

A Gentle Introduction to
C++ Programming

Tutorial: Drawing lines.

 
g.draw(DrawableLine(60,20,60,100)) draws a line from (60,20) to (60,100) using the current color, stroke width and line cap.

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