signaturecapture doesn't work

H, everybody

i am just a hobby developer with almost no knowledge and bought me the FNC collection especially for the signature component. but I have a problem to save it to image. this my code

button1
signaturecapture1.SaveToImagefile('c:\test\test.png');

button2
signatureCapture1.Loadfromfile('c:\test\test.png');

when execute button1 it saves a image

but when a reopen with loadfromfile it shows me a black rectangle that stays even when I empty the signature with the x or empty = true

I just wanne be able to print the signature on a document within lazreport

thanks
angel

Your question was answered by direct email.

yes I now and I thank you but no solution to the black screen was given.

this is the email
Mr. Angel,

SaveToFile(), LoadFromFile() persist the signature in vector format.

If you want to save as image file, please use the function
SignatureCapture.SaveToImageFile()
`Schermafbeelding 2020-08-02 om 10.36.04

Hi,

  1. if you want to load a signature in a SignatureCapture component, you have to save it to the native siganture file and not to the image.
  2. there is a bug in the SignatureCapture component that saves black images. To fix it you need in the LCLTMSFNCSignatureCapture.pas file in the following procedures: TTMSFNCCustomSignatureCapture.SaveToImageFile(FileName: string); (line 605 in fnc3.1.0.1) and TTMSFNCCustomSignatureCapture.SaveToImageStream(AStream: TStream); (line 625) between lines:
    bmp.Height := Round(Height);
    and
    g := TTMSFNCGraphics.Create(bmp.Canvas);
    insert code:
    bmp.Canvas.Brush.Color := Self.Fill.Color;
    bmp.Canvas.FillRect(0, 0, bmp.Width, bmp.Height);

so after the change it should look like this:
obraz

Sample application in attachementpublished.zip (108,2 KB)

Dmitruk Paweł thank you for your info i gonna try tomorrow thanks again

Dmitruk Thanks again it works just fine now !!!

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.