Hallo ich möchte mit diesem Code ein Bild einscannen und in eine Datenbank ablegen
Delphi-Quellcode:
procedure TForm1.DelphiTwain1TwainAcquire(Sender: TObject;
const Index: Integer; Image: TBitmap; var Cancel: Boolean);
begin
clientdataset1.FieldByName('personalausweishinten').Assign(image);
Cancel := TRUE; {Only want one image}
end;
procedure TForm1.Button1Click(Sender: TObject);
var
SelectedSource: Integer;
begin
{It is always recommended to load library dynamically, never forcing}
{final user to have twain installed}
if delphiTwain1.LoadLibrary then
begin
{Load source manager}
delphiTwain1.SourceManagerLoaded := TRUE;
{Allow user to select source}
SelectedSource := delphiTwain1.SelectSource;
if SelectedSource <> -1 then
begin
{Load source, select transference method and enable (display interface)}
delphiTwain1.Source[SelectedSource].Loaded := TRUE;
delphiTwain1.Source[SelectedSource].TransferMode := ttmMemory;
delphiTwain1.Source[SelectedSource].Enabled := TRUE;
end {if SelectedSource <> -1}
end
else
showmessage('Twain is not installed.');
end;
Er scannt nur das dbimage1 bleibt leer. woran kann das liegen