procedure ClearCanvas;
var
R: TRect;
begin
//Clear the content of the canvas
with Canvas do
begin
Brush.Style := bsSolid;
Brush.Color := clWhite;
GetWindowRect(Handle,R);
R.TopLeft := ScreenToClient(R.TopLeft);
R.BottomRight := ScreenToClient(R.BottomRight);
FillRect(R);
end;
end;