Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-04

TPicture SIGSEGV

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Leonardo M. Ramé

Hi, I'm using Lazarus on x86_64 compiled from today and fpc 20240. I've placed a TImage with a picture assigned, on a TForm.

I need to do Image1.Picture.Bitmap, to obtain the bitmap associated, but when picture.bitmap is called, the TPicture.ForceType method is called, and I get a SigSegv there:

procedure TPicture.ForceType(GraphicType: TGraphicClass);
var
  NewGraphic: TGraphic;
begin
  if not (FGraphic is GraphicType) then
  begin
    NewGraphic := GraphicType.Create;
    NewGraphic.Assign(FGraphic); <--- boom!
    FGraphic.Free;
    FGraphic := NewGraphic;
    FGraphic.OnChange := @Changed;
    FGraphic.OnProgress := @Progress;
    Changed(Self);
  end;
end;

The assigned image is a .png I've set using the ObjectInspector's TImage.Picture property.

Why the SIGSEGV is raised?.

Regards,

Reply by email

Bart
to Leonardo M. Ramé
Leonardo M. Ram? wrote 7 lines
Hi, I'm using Lazarus on x86_64 compiled from today and fpc 20240. I've placed a TImage with a picture assigned, on a TForm. I need to do Image1.Picture.Bitmap, to obtain the bitmap associated, but when picture.bitmap is called, the TPicture.ForceType method is called, and I get a SigSegv there: .....

Please post it in bugtracker, along with a self-contained example (sources only), with the PNG already loaded in the image.

Bart

Reply by email

Leonardo M. Ramé
to Bart
Bart wrote 15 lines
On 4/15/13, Leonardo M. Ram? wrote: > Hi, I'm using Lazarus on x86_64 compiled from today and fpc 20240. I've > placed a TImage with a picture assigned, on a TForm. > > I need to do Image1.Picture.Bitmap, to obtain the bitmap associated, but > when picture.bitmap is called, the TPicture.ForceType method is called, > and I get a SigSegv there: > ..... Please post it in bugtracker, along with a self-contained example (sources only), with the PNG already loaded in the image. Bart

Well, on an empty project it works...

Reply by email