papyrus logo

Rectangles

A rectangle is drawn with the (x,y) coordinate as the upper left corner, and with a specified width and height.

Rotation of a rectangle occurs about a centroid which is defined as the center of the rectangle, or more formally as (x+w/2, y+h/2).

The following contains an example that will add a rectangle with a 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.

rectangle.png

Rectangle drawn by example code below


Generated on Fri Apr 16 12:41:04 2010 for papyrus by doxygen 1.6.1