Re: [Lazarus] A bitmap strange issue

2018-04-22 Thread Ondrej Pokorny via Lazarus
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

Re: [Lazarus] A bitmap strange issue

2018-04-22 Thread Giuliano Colla via Lazarus
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

Re: [Lazarus] A bitmap strange issue

2018-04-22 Thread Mattias Gaertner via Lazarus
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

Re: [Lazarus] A bitmap strange issue

2018-04-22 Thread Giuliano Colla via Lazarus
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

Re: [Lazarus] A bitmap strange issue

2018-04-22 Thread Giuliano Colla via Lazarus
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;

Re: [Lazarus] A bitmap strange issue

2018-04-22 Thread Ondrej Pokorny via Lazarus
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

Re: [Lazarus] A bitmap strange issue

2018-04-22 Thread Michael Van Canneyt via Lazarus
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

Re: [Lazarus] A bitmap strange issue

2018-04-22 Thread Giuliano Colla via Lazarus
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