Placing other objects in a picture
To put text in a picture, Canvas.TextOut(x, y, 'text') is used: (x, y) are the coordinates of the upper left corner of the text. The look of the text is set with the Canvas.Font properties: Font.Size, Font.Color, Font.Name; the standard brush paints the background of the text, so for text without a background set Brush.Style := bsClear; Canvas.TextWidth('text') gives the width of the text and is used to centre it. For parts of an ellipse there are three methods that take eight numbers: Arc(x1, y1, x2, y2, x3, y3, x4, y4), Chord(…) and Pie(…). The first four numbers give the rectangle around the ellipse; (x3, y3) is a point on the starting ray from the centre and (x4, y4) a point on the ending ray. The line is drawn from the starting ray to the ending ray counterclockwise, so the order of the points matters. Arc draws only the arc, Chord draws the arc and the segment joining its ends, Pie draws the arc and two radii (a sector); Chord and Pie fill the inside with the brush.
| Method | Draws |
|---|---|
| Arc | only the arc |
| Chord | the arc and the segment joining its ends |
| Pie | the arc and two radii (a sector) |
A pupil drew a circle to stand for one hour of study and shaded 30 minutes as a sector. A half circle is 180°, so the sector took exactly half. The label was written beside it at chosen coordinates.
Graphic designers, infographic makers and designers of clock or gauge screens place circle parts and labels by coordinates.
Draw a circle round a cup or a lid, divide it by eye into 8 equal slices, and write down how many degrees one slice is.
“The atlas of parts”: a pair draws 4 different parts of one circle with the three methods, writes the points of the starting and ending rays for each in advance and compares them with the picture.