Curves Not Redrawing on TImage Canvas (Made on TBgrabmp instead) lazarus / 39-Graphics ---------------------------------------------------------------------- Boleeman · 2024-09-22 11:33 Hi All. I converted an interesting Delphi program that creates a Bird of Prey (Eagle like) fractal and other fractals on a TImage. I can only get it to draw once, after selecting a fractal entry from the TComboBox and clicking btnGenerate. Successive clicks of btnGenerate just clear the TImage canvas and make it white. Can't seem to work out why it is happening, Any help would be greatly appreciated. The program has the TImage set to 32Bits :  Fractal.Picture.Bitmap.PixelFormat := pf32Bit; and It uses scanline to fill in the pixels :  pixel := Fractal.Picture.Bitmap.ScanLine; ---------------------------------------------------------------------- wp · 2024-09-22 12:56 Maybe: You are setting the Canvas.Brush of the Image to clWhite but your drawing is on the Canvas of the Picture.Bitmap. I don't know... I always found drawing directly on a TImage to be too complicated (htt ps://wiki.freepascal.org/Developing_with_Graphics#Draw_to_a_TImage). And TImage is loaded with features which are not needed to display a simple user drawing (scaling, centering, multi-graphic-format support). I'd normally create a TBitmap independently of the TImage, set its size to the image size and create the drawing here. Then I'd assign this bitmap to the Image.Picture. Or, even more minimalistic: I'd use a TPaintbox instead of the TImage and draw the bitmap in the Paintbox.OnPaint event. ---------------------------------------------------------------------- Boleeman · 2024-09-22 22:46 Thanks WP for your reply. I wasn't sure why it only rendered once. I got so frustrated with the TImage version that I ended up making a TBgrabmp version, that Renders on the Bgrabmpcontrol and Zooms perfectly. With the TImage version I stuck with most of the Delphi coding, so perhaps something works properly with Delphi but not with Lazarus. Perhaps it's the pf32Bit format, not sure. In the TBgrabmp version I replaced a number of parts with TBgrabmp specific parameters (used Putpixel instead of Setpixel), modified the HSV coding and no need for pf32Bit format specification. Both of the attached png pictures were actually Zoomed from a small 9 mm x 9mm square region on the original renderings. The 1st attached png is a zoom of the bird of prey fractal, in which I zoomed in on a "speck of blue" on the original fractal. (Almost feel like I am exploring a secret lake on some undiscovered planet). The 2nd attached png is a zoom of a small 9mm region to the left side of the original drawing. (I like how a ghost mask appears of the ship, kinda really cool). (I reduced the size of the burning ship png so I could attach it to this thread)