So nun mehr habe ich ein neues Problem.
Das Scannen klappt und er speichert es auch in eine Datenbank ab siehe Code.
Delphi-Quellcode:
procedure TForm1.TwainTwainAcquire(Sender: TObject; const Index: Integer;
Image: TBitmap; var Cancel: Boolean);
begin
clientdataset1.Fieldbyname('Bild').Assign(Image);
Cancel := True;//Only want one image
end;
procedure TForm1.DoDestroy;
begin
Twain.Free;//Don't forget to free Twain!
//inherited;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
clientdataset1.Insert;
//Create Twain
if Twain = nil then begin
Twain := TDelphiTwain.Create;
Twain.OnTwainAcquire := TwainTwainAcquire;
end;
//Load Twain Library dynamically
if Twain.LoadLibrary then
begin
//Load source manager
Twain.SourceManagerLoaded := TRUE;
//Allow user to select source -> only the first time
if not Assigned(Twain.SelectedSource) then
Twain.SelectSource;
if Assigned(Twain.SelectedSource) then begin
//Load source, select transference method and enable (display interface)}
Twain.SelectedSource.Loaded := TRUE;
Twain.SelectedSource.ShowUI := TRUE;//display interface
Twain.SelectedSource.Enabled := True;
end;
end else begin
ShowMessage('Twain is not installed.');
end;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
clientdataset1.Post;
end;
Jedoch wenn ich mein Programm beende meldet er folgendes siehe Bild.