Graphics programming. Basics


To draw a rectangle, use the commands:
rectangle (x1, y1, x2, y2);

Filled rectangle. To draw a filled rectangle:
1. Set fill style and color
2. The command bar(x1, y1, x2, y2); draws a filled rectangle with the style and color set by the command setfillstyle (style, color);
setfillstyle(style, color);
bar (x1, y1, x2, y2);
Fill Styles:
0 – disable fill
1 – solid fill
3,4,5,6 – slanted lines
7.8 – mesh
9,10,11 – dot patterns

In order to draw, you need to execute the command
circle ( x, y, R );
The circle will be drawn centered at the point with coordinates (x,y) and radius R

Filling a closed area in which all pixels of the same color is done with the
command floodfill ( x, y, c);
(x, y) - coordinate of any point inside the area to be painted
c - the color that the area will be filled with