* * *

Author Topic: Pasting image/png into Lazarus application throws exception  (Read 498 times)

hakelm

  • Jr. Member
  • **
  • Posts: 97
Pasting image/png into Lazarus application throws exception
« on: September 19, 2018, 10:47:56 pm »
I am trying to paste images into a tpicture with
pic.LoadFromClipboardFormat(Clipboard.FindPictureFormatID);
jpegs seem to work ok, but I have trouble with mimetype image/png, with ID 119.
An exception, 'External: SIGSEGV', is thrown in fpimagebitmap line 61:
Result := 'image/' + DefaultFileExt;
This should really not be possible since the value of DefaultFileExt is 'png' at this point.
Can someone please help me or give me an explanation.
I am using Lazarus 1.9.0 running under Ubuntu 16.04
H

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 740
Re: Pasting image/png into Lazarus application throws exception
« Reply #1 on: September 20, 2018, 04:07:11 am »
hello,
try to use the example project Image Clipboard from here. It uses another way to paste a picture from the clipboard. In attachment a screenshot of this project :  copy an image from gimp and paste the image with the paste button of the project . Ubuntu 16.04   Lazarus 1.8.2
The number displayed at the bottom of the form is the PictureFormatId. From what do you copy your picture ?

Friendly, J.P
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

hakelm

  • Jr. Member
  • **
  • Posts: 97
Re: Pasting image/png into Lazarus application throws exception
« Reply #2 on: October 10, 2018, 02:57:38 pm »
Thank you.
I am sorry for the long delay of my answer.
This due to the fact that I observed that my code works on one but not on the other of two nearly identical machines running Ubuntu 16.04 and I haven't had time to sort that out yet.
I will be back when I know better.
H

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus