How to draw a rectangle, and then delete it lazarus / 39-Graphics ---------------------------------------------------------------------- BlueIcaro · 2011-04-05 19:09 Hello, I use this code to draw a rectangule, over a canvas Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   Canvas.Brush.Style := bsClear;  Canvas.Pen.Mode := pmCopy;  Canvas.Rectangle(100,100,200,200); When I want to delete it, I use: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i    Canvas.Brush.Style := bsClear;  Canvas.Pen.Mode := pmNotCopy;  Canvas.Rectangle(100,100,200,200);         But This code, makes a rectangle with a white border. Any help? /BlueIcaro ---------------------------------------------------------------------- typo · 2011-04-05 19:20 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: Code: [Select]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: Code: [Select]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; ---------------------------------------------------------------------- BlueIcaro · 2011-04-05 20:27 Thnak you!!, it's works!!! /BlueIcaro