<p style="padding:0 0 0 0; margin:0 0 0 0;">Hi,</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">@ <span style="font-size: 10pt;">MyBitmap := Image1.Picture.Bitmap;</span></p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">This line only copies pointer, but I<span style="font-size: 10pt;">mage1.Picture.Bitmap belongs to Image1 and it should care itself.</span></p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">If you need copy of the bitmap you shoud use:</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">MyBitmap.Assign(<span style="font-size: 13.3333px;">Image1.Picture.Bitmap);</span></p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"><span style="font-size: 13.3333px;">V.</span></p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">______________________________________________________________<br />
> Od: Giuliano Colla via Lazarus <lazarus@lists.lazarus-ide.org><br />
> Komu: Lazarus mailing list <lazarus@lists.lazarus-ide.org><br />
> Datum: 21.04.2018 17:18<br />
> Předmět: [Lazarus] A bitmap strange issue<br />
></p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<blockquote style="margin: 0px; font-family: monospace; font-size: 12.25px; white-space: pre;">procedure TForm1.Button1Click(Sender: TObject); var Filename: String; begin if OpenPictureDialog1.Execute then begin // MyBitmap := Image1.Picture.Bitmap; <-------This causes a sigsev in FreeImage Filename:= OpenPictureDialog1.FileName; Image1.Picture.LoadFromFile(Filename); If assigned(MyBitmap) then begin MyBitmap.FreeImage; FreeAndNil(MyBitmap); end; end; end;</blockquote>
Giuliano<br />
<br />
<br />
<br />
----------<br />
<br />
-- <br />
_______________________________________________<br />
Lazarus mailing list<br />
Lazarus@lists.lazarus-ide.org<br />
<a href="https://lists.lazarus-ide.org/listinfo/lazarus">https://lists.lazarus-ide.org/listinfo/lazarus</a><br />