[Lazarus] A bitmap strange issue
Giuliano Colla
giuliano.colla at fastwebnet.it
Sun Apr 22 17:06:43 CEST 2018
Il 22/04/2018 13:49, Ondrej Pokorny via Lazarus ha scritto:
> Do you really mean that
> Image1.Picture.Bitmap.SomeProperty := SomeValue;
> should apply SomeProperty := SomeValue on a copied object of Bitmap
> and produce a memory leak?
No, I mean that like
Image1.Picture.Bitmap := SomeBitmap;
actually executes a
Image1.Picture.Bitmap.assign(SomeBitmap);
(see TPicture.SetGraphic called by TPicture.SetBitmap in picture.inc), so
SomeBitmap := Image1.Picture.BItmap;
should execute (with proper checks)
SomeBitmap.assign(Image1.Picture.Bitmap);
I speak about manipulating the Tpicture.Bitmap property itself, not the
TBitmap properties, which would not be affected.
Giuliano
More information about the Lazarus
mailing list