Rectangle- Draws a rectangle
Draws a rectangle in the graph.
- Rectangle(X1,Y1,X2,Y2[,R])
Parameters:
- (int) X1: horizontal coordinate of the upper left vertex;
- (int) Y1: vertical coordinate of the upper left vertex;
- (int) X2: horizontal coordinate of the lower right vertex;
- (int) Y2: vertical coordinate of the lower right vertex;
- (int) R: rotation expressed in degrees (optional).
Description:
Use Rectangle to draw a rectangle. The rectangle is defined by the points X1 Y1 (top left corner) and X2 Y2 (bottom right corner).
The perimeter of the rectangle is drawn using the current pen and color (Pen, ColorPen), while the surface is filled with the current brush or color (Brush, ColorBrush).
Optional parameter R defines how to rotate the rectangle around its center or around a origin point defined with the GraphicOrigin instruction. The value is expressed in degrees. If omitted the rotation is 0 degrees.
Drawing with the mouse:
From the drawing context menu choose Rectangle. Move the pointer over one of the two vertices of the rectangle and press the left button to fix it. Move the pointer to the opposite vertex - a rectangle from the first vertex to the mouse pointer is drawn - and press the left button.
Once the coordinates of the rectangle are defined, you use the mouse wheel to rotate it around its hypothetical center or around a point of origin defined with the GraphicOrigin instruction. If you use the mouse wheel with the Ctrl key, the rectangle will be zoomed in or out. To insert the Rectangle instruction into the graph, confirm with the left mouse button.