recently my company bought a Wacom STU-530 signature pad and I've to realize a prgram that acquire the client signature from it and create a pdf with the signature. I use FastReport for realizing the PDF, but I need to acquire the signature from the wacom tablet. With the sdk I realized this code:
procedure TfrmMain.btnFirmaClick(Sender: TObject);
var
objFirma: SigObj;
ctlFirma: TSigCtl;
picFirma: TPicture;
res: CaptureResult;
begin
picFirma := TPicture.Create;
ctlFirma := TSigCtl.Create(Self);
res := ctlFirma.Capture('Firmare per accettazione',
'Formazione del personale in affiancamento');
case res of
CaptureOK: begin
objFirma := SigObj(ctlFirma.Signature);
SetOlePicture(picFirma, objFirma.Picture(300, 300, 'image/bmp', 0.5, $000000,
$ffffff, -1.0, -1.0, RenderOutputPicture or RenderColor32BPP or
RenderEncodeData));
picFirma.SaveToFile('firma.bmp');
end;
end;
ctlFirma.Free;
picFirma.Free;
end;
The SigObj has a method that return a IPictureDisp and I need to convert it into a TImage so I've used the SetOlePicture, but When I save the Image it is unreadable. If I try to save the picture with
picFirma.bitmap.SaveToFile('firma.bmp')
the resulting bitmap is void. What is wrong in my code?