There is a trick to drawing to the canvas. Using OnPaint will allow the form to be repainted every time the form is refreshed. If OnPaint is not used, then what is drawn will disappear when part of the form is moved off screen or the form refreshes. Use Canvas. to bring up all of the properties, functions and procedures that canvas has to offer.
Examples:
Canvas.Pen.Color := clRed;
Canvas.Pen.Width := 25;
The form is a grid. Each part of the form has an x and y coordinate. Drawing to the canvas means that each part of the drawing commands must be given an x and y coordinate.
Example:
Canvas.TextOut(165,83, '11');
Note:
If you get an error with “end.” highlighted within the lpr tab, comment out the {$IFDEF Windows} {$R project1.rc} {$ENDIF} line. Lazarus will recreate this line later on in the tutorial. It seems to have to do with an icon bug.
More Information:
http://bugs.freepascal.org/view.php?id=15581
The code for the Quick Clock Quizzer can be download on the Tutorial 32 page
Video: Free Pascal Tutorial 25 - Canvas Drawing With Pen, Brush and Colors - Quick Clock Quizzer - Lazarus
