Fractals Image: AutoSize Image Canvas Size to Fit Image lazarus / 39-Graphics ---------------------------------------------------------------------- Boleeman · 2023-07-01 11:56 Hi All. I have been playing around with a LSystem Fractal Image program and wondered if anyone could possibly help in explaining how to add an AutoSize Image Canvas Size to Fit Image  feature. When I change the recursion level of a given fractal it's rendered image gets bigger and is not shown completely on the Timage. Is there a way of setting the image size automatically by pre-calculating the range of X and Y pixel values? Attached is a screenshot. After compiling, click Pentaplexity in the listbox to render it. then change iterations to 5 in the memo and click Draw. When iterations = 4 is changed to iterations = 5  the picture becomes too big for the image control Thanx in advance. I thought of using a BgraBmp image with a viewport to scroll, but not sure really how to do it? ---------------------------------------------------------------------- Boleeman · 2023-07-02 06:26 Actually had an idea for autosizing. Use a buffer and create 2 dynamic arrays that store the X and Y coordinates of the points that are calculated by the fractal rules. Then find the maximum X and Y values Set the image size to just a bit bigger than that size. Lastly write the fractal image to canvas. ---------------------------------------------------------------------- Boleeman · 2023-07-21 15:44 Some sample pictures from the program: ---------------------------------------------------------------------- lainz · 2023-07-22 12:33 Attached the PNG with transparency. Requires BGRABitmap and BGRAControls. Edit: wrong post, but of the same author so no problem? ---------------------------------------------------------------------- Boleeman · 2023-07-22 15:55 No problem here. Wow thanks Sooooooo Much Lainz. So much appreciated. Attached I have a whole lot of presets for the lsystem program. If anyone wants to play around compile the program in post 1 and then just copy the presets into the samples folder. Below are some latest pictures. I spent a number of "Addicted Hours making all sorts of cool graphics designs". 212 different designs so far. The Lsystem program has a lot of potential to make so very cool graphics designs. I will now try to implement the BGRABitmap into it. I am so happy playing with Lazarus. Along with BGRABitmap I see how it has great graphics effects (much better than VB6). I just came across that hurdle of implementing BGRABitmap and understanding what to do in different parts of a program. The examples in the Wiki show small bits and pieces but Lainz' code really helped.