[solved] drawing with layers lazarus / 39-Graphics ---------------------------------------------------------------------- speter · 2022-06-05 06:29 G'Day Folks, I have written a program to draw on a number of layers; the program allows the user to show / hide layers and all that works okay. What doesn't work is clearing the layer(s). The layering is implemented by having multiple Timages with the transparent colour set; this works fine - first time around - but doesn't work when "erasing" the existing graphics... I've attached the project and 2 images to show what I mean; in one image you see a number of coloured polygons; in the other the previous polygons are now black (the "transparent" colour). Any help / suggestions would be very welcome! cheers S. ---------------------------------------------------------------------- paweld · 2022-06-05 06:54 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 procedure TForm1.Button1Click(Sender: TObject);var  a : byte;  b : TButton;  h,w : integer;begin  b := TButton(sender);  if b.caption = 'Draw' then    begin      for a := 1 to num_layers do        draw_layer(a);       b.caption := 'Clear';    end  else    begin      w := image_layer1.Width;      h := image_layer1.Height;       for a := 1 to num_layers do        layers[a].Picture.Clear; //<---------       b.caption := 'Draw';    end;end; ---------------------------------------------------------------------- speter · 2022-06-05 06:59 Thanks very much @ paweld. cheers S.