Grazie per l'aiuto, ho scaricato l'esempio TestSigCapt, riprodotto il file FLSIGCTLLib_TLB di cui non si poteva fare il download. Tutto ok, applicazione compilata ma quando vado a premere sul pulsante mi dice "Interfaccia non registrata" (sembra il messaggio relativo alla libreria ole32.dll di windows...). Decisamente ostico l'utilizzo di queste tavolette.
unit TestSigCapForm;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls,
Vcl.StdCtrls, FLSIGCTLLib_TLB;
type
TTestSigCaptForm = class(TForm)
Button1: TButton;
Memo1: TMemo;
Image1: TImage;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
TestSigCaptForm: TTestSigCaptForm;
implementation
{$R *.dfm}
procedure TTestSigCaptForm.Button1Click(Sender: TObject);
var
sigCtl: TSigCtl;
res: CaptureResult;
sigObj1: SigObj;
fileName: String;
begin
Memo1.Lines.Add('btnSign was pressed');
sigCtl := TSigCtl.Create(Self);
res := sigCtl.Capture('Who', 'Why');
if res = CaptureOK then
begin
Memo1.Lines.Add('Signature captured successfully');
fileName := 'sig1.bmp';
sigObj1 := SigObj(sigCtl.Signature);
sigObj1.ExtraData['AdditionalData'] := 'Delphi test: Additional data';
sigObj1.RenderBitmap(fileName, 200, 150, 'image/bmp', 0.5, $ff0000, $ffffff, -1.0, -1.0, RenderOutputFilename or RenderColor32BPP or RenderEncodeData);
Image1.Picture.LoadFromFile(fileName);
end
else
begin
Memo1.Lines.Add('Signature capture error res='+IntToStr(res));
case res of
CaptureCancel: begin Memo1.Lines.Add('Signature cancelled'); end;
CaptureError: begin Memo1.Lines.Add('No capture service available'); end;
CapturePadError: begin Memo1.Lines.Add('Signing device error'); end;
else begin Memo1.Lines.Add('Unexpected error code'); end;
end;
end;
end;
procedure TTestSigCaptForm.FormCreate(Sender: TObject);
begin
Image1.Canvas.Create;
end;
end.