cairo_set_line_cap.box

Caps available when drawing border lines

../../_images/cairo_set_line_cap.png

this sample shows the available cap styles which can be selected when drawing border lines To run this example you will need the following file(s): ./cairo_set_line_cap.box. If the example requires more than one file, then you should put them into the same directory. You can then launch Box with box -l g ./cairo_set_line_cap.box.

// One example taken from the samples page of the Cairo graphic library
// (http://cairographics.org/samples/), rewritten in Box.
include "g"

w = Window["rgb24", (256, 256), .Res[1]][
  Line[Border[30, Cap["butt"]], (64, 50), (64, 200)]
  Line[Border[30, Cap["round"]], (128, 50), (128, 200)]
  Line[Border[30, Cap["square"]], (192, 50), (192, 200)]

  // draw helping lines
  Lines[Border[2.56, color.red]
        (64, 50), (64, 200); (128, 50), (128, 200); (192, 50), (192, 200)]
]

w.Save["cairo_set_line_cap.png"]

Table Of Contents



This Page



Get The figure description language: Box at SourceForge.net. Fast, secure and Free Open Source software downloads