Because clWhite is the inverse color of clBlack.
In order to restore the background correctly, you need to save it previously.
To save and draw:
var
r, r2 :trect;
begin
r.Top := 100;
r.Left := 100;
r.Right := 200;
r.Bottom := 200;
r2.Top := 0;
r2.Left := 0;
r2.Right := 100;
r2.Bottom := 100;
Image2.Canvas.Copyrect(r2, canvas, r);
Canvas.Brush.Color := clBlack;
Canvas.Pen.Color := clBlack;
Canvas.Rectangle(100,100,200,200);
end;
To restore:
var
r, r2 :trect;
begin
r.Top := 100;
r.Left := 100;
r.Right := 200;
r.Bottom := 200;
r2.Top := 0;
r2.Left := 0;
r2.Right := 100;
r2.Bottom := 100;
Canvas.Copyrect(r, image2.canvas, r2);
end;