On 22.04.2018 17:06, Giuliano Colla via Lazarus wrote:
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 mea
Il 22/04/2018 17:39, Mattias Gaertner via Lazarus ha scritto:
And what to do with
W := Image1.Picture.BItmap.Width?
You're right, there's no easy way out.
The original sin has been maybe to call Bitmap a TPicture property which
isn't really a TBitmap, as the GetBitmap and SetBitmap methods
On Sun, 22 Apr 2018 17:06:43 +0200
Giuliano Colla via Lazarus wrote:
>[...]
> 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 proper
Il 22/04/2018 13:22, Michael Van Canneyt via Lazarus ha scritto:
This is how all properties that are TPersistent descendents work, so
this
behaviour should not come as a surprise.
I wouldn't say so.
E.g. TCanvas is a TPersistent descendent, but the Canvas property of a
TCustomControl is de
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;
actua
On 22.04.2018 12:38, Giuliano Colla via Lazarus wrote:
Il 21/04/2018 18:07, Vojtěch Čihák via Lazarus ha scritto:
@ MyBitmap := Image1.Picture.Bitmap;
This line only copies pointer, but Image1.Picture.Bitmap belongs to
Image1 and it should care itself.
That's what I had guessed, but this
On Sun, 22 Apr 2018, Giuliano Colla via Lazarus wrote:
Il 21/04/2018 18:07, Vojtěch Čihák via Lazarus ha scritto:
@ MyBitmap := Image1.Picture.Bitmap;
This line only copies pointer, but Image1.Picture.Bitmap belongs to Image1
and it should care itself.
That's what I had guessed, but th
Il 21/04/2018 18:07, Vojtěch Čihák via Lazarus ha scritto:
@ MyBitmap := Image1.Picture.Bitmap;
This line only copies pointer, but Image1.Picture.Bitmap belongs to
Image1 and it should care itself.
That's what I had guessed, but this means that there's a patent
inconsistency, as shown in