TMSFNCSignatureCapture problem

Delphi Rio 10.3.2
Latest FNC UI component pack
FMX App for Windows/iOS

Having trouble with the signature capture component when using savetostream.  All I get is a black background image - no signature.  In my code I also test with savetofile with same result. 

Any hints as to why this would be happening.

Bill Zwirs

SaveToFile/SaveToStream persist in the native internal vector format of the TTMSFNCSignatureCapture component.
If you need it as image file, use SaveToImageFile / SaveToImageStream

Have just tried using SaveToImageFile / SaveToImageStream but still get same result - black rectangle.  Is there something else I could be missing here.

Bill Zwirs

What image file format do  you save to? Did you choose PNG?

No. Image format is bmp. Just for a bit of background....I am populating fields in a pdf (invoice) and then adding a customer signature.  Using Gnostice Document Viewer component to achieve this and all works fine except for adding the signature. I have created an example signature .bmp file for testing  using Microsoft Paint and that works good so the problem is not the document viewer component. Gnostice tell me that I must use either bmp or jpg on their component - there is currently no support for png. The code I use is:

procedure TMainForm.Send_SignatureToInv;
var
  LFormField : TgtPDFFormField;
  ms,
  TempStream : TMemoryStream;
  LImage     : TgtBitmapSurface;
  bmp        : tBitmap;
begin
  LImage := TgtBitmapSurface.Create;
  TempStream := TMemoryStream.Create;
  ms := TMemoryStream.Create;
  bmp := TBitmap.Create;
  try
    InvSign.SaveToImageStream(ms);
    InvSign.SaveToImageFile('sig1.bmp');       //test ***********
    bmp.LoadFromStream(ms);
    bmp.SaveToFile('sig2.bmp');       //test ***************
    bmp.SaveToStream(TempStream);
    LImage := TgtBitmapSurface.Create;
    LImage.LoadFromStream(TempStream);
    LFormField := TgtPDFPage(InvViewer.ActiveDocument.GetPage(1)).Forms.ByName('SigButton');
    if Assigned(LFormField) and (LFormField.GetElementType = ietFormPushButton) then
      TgtPDFFormPushButton(LFormField).SetImage(LImage);
  finally
    InvSign.Empty := True;
    TempStream.Free;
    ms.Free;
    LImage.Free;
    bmp.Free;
  end;
end;

The test lines are there so I can see what the image looks like and each time it is a black rectangle (this matches what I see on the PDF).  'InvSign' is the name given to the signature capture component.  Never really worked with graphics before so it might simply be that my code is wrong.  Any help will be appreciated.

Bill Zwirs

Can you try saving it to PNG/JPG and see what happens? It could potentially be an issue with the BMP format in FMX.