In Delphi there is no such thing as TCanvas.Width or TCanvas.Height - the effective size of the canvas is determined by the class to which the canvas belongs, e.g. TBitmap.Width, TForm.Width, TPaintbox.Width. I know that Lazarus does provide these properties for TCanvas, but I am not sure whether the values are always reliable because the Canvas is tied to its Handle and this is usually valid only withing a painting operation. In fact, your DoIt method is drawing outside paint operations which is even prohibited in some widgetsets.