Circles

A circle is drawn centered on the x,y coordinate with a specified radius.

The following contains an example that will add a green circle with a black border to a canvas. The blue lines represent the x and y axes, and show through since an alpha value of 0.9 is used.

circle.png

Circle drawn by example code below

Circle::pointer example_circle(bool fill, bool outline) {
  // Create a circle with a radius of 50
  Papyrus::Circle::pointer circle = Papyrus::Circle::create( 50 );

  // Set the fill color to green, with an alpha value of 0.9
  if (fill) circle->set_fill( Cairo::SolidPattern::create_rgba(0.0, 1.0, 0.0, 0.9) );

  // And the outline color to black
  if (outline) circle->set_outline( Cairo::SolidPattern::create_rgba(0.0, 0.0, 0.0, 0.9) );

  return circle;
}

Generated on Sun Mar 11 10:01:28 2007 by  doxygen 1.5.1