Seeing CLOUDS: But outside the sky is clear. How? lazarus / 39-Graphics ---------------------------------------------------------------------- Boleeman · 2025-04-25 03:25 Ah ........ that's because the clouds are in digital form. A Lazarus program to make clouds. SHARPNESS  --->  Lower is fluffier. Higher is sharper. DENSITY       --->  0.7=Nearly clear sky, 0.2=Nearly full of clouds. Enjoy. ---------------------------------------------------------------------- Lulu · 2025-04-25 17:57 Hi Boleeman, thank you for all your graphic demos! I compiled the clouds demo in debug mode and an exception occurs on the line: 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.Timer1Timer(Sender: TObject);...col := RGBToColor(R + Round(z * (256 - R)), G + Round(z * (256 - G)), B + Round(z * (256 - B)));... if I replace this line by this one, no more exception: 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 col := RGBToColor(R + Round(z * (255 - R)), G + Round(z * (255 - G)), B + Round(z * (255 - B))); Heaptrc report 102 unfreed memory block at the termination of the program. If we add: 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.FormDestroy(Sender: TObject);var  i: Integer;begin  SkyBmp.Free;  for i := 0 to 3 do  begin    OctavesA[i].Free;    OctavesB[i].Free;  end;  Clouds.Free;end; its not enough, there still remain 70 unfreed blocks. Nothing serious, but it's better when the code ends cleanly. ---------------------------------------------------------------------- Boleeman · 2025-04-26 04:12 Thanks Lulu. for finding those errors. For some reason they did not happen on my Dell AMD Cpu laptop. I was in a hurry to upload yesterday, as I made quite a number of other programs. For the clouds program I also forgot the destructor: type   TArray2D = class   private     FWidth, FHeight: Integer;     FData: array of Double;   public     constructor Create(AWidth, AHeight: Integer);     destructor Destroy; override; and under implementation {$R *.lfm}  Add this: destructor TArray2D.Destroy; begin   SetLength(FData, 0); // Or use Finalize(FData);   inherited Destroy; end;  Thank you Lulu for letting me know. TRon:  Yes it is confusing, but I like the clouds produced and thought it would be cool to share what I had to others. ---------------------------------------------------------------------- TRon · 2025-04-26 04:20 Funny that when added (though right decision) it makes matters worse  The 'problem' is that T2darray is a class and in the code it gets created, stored into a variable and that variable is used to for example smooth the data, which returns a new instance of T2darray and assigning to that same variable. At quick glance there is not an easy fix. E.g. I dunno if it is possible to for instance apply the effect to the existing instance of the t2array that will achieve the same results.