Each component has its own canvas that starts from 0, 0. If you have a TPaintBox for example you draw to it starting from 0, 0. If you move its Left and Right elsewhere the graphics move along with it.
However, if i start new project and create new label with default properties on form, and put this in FormPaint event
with Label1 do begin
canvas.Pen.Color:=clBlack;
canvas.Pen.Width:=1;
canvas.Brush.Style:=bsClear;
Canvas.Rectangle(0, 0, Width, Height);
end;
I do not see a rectangle. I tried with setting its Transparent property false and Color property to clBtnFace, but still not seeing it.
Lazarus 0.9.31 SVN 29541, fpc 2.4.3. Windows 7 32-bit.
edit:
if i add Label1.Repaint; after Rectangle it shows, and is flashing. But it seems like endless loop that hangs up application. I had to stop the app from Lazarus as it refused to close.