Hola.
No sé si te servirá pero yo tuve un problema similar y lo solucioné descargando y volviendo a cargar la libreria en cada captura, te pongo los dos procedimientos por si te sirven de ayuda.
Al seleccionar el dispositivo...
Código Delphi
[-]
procedure TNTFormCompras.NTButton1Click(Sender: TObject);
var
SelItem: Integer;
begin
try
delphiTwain1.UnloadLibrary;
except
end;
if DelphiTwain1.LoadLibrary() then
with DelphiTwain1 do
begin
LoadSourceManager();
SelItem := SelectSource();
if SelItem = -1 then begin
ShowMessage('No se ha seleccionado dispositivo');
exit;
end;
end
else
ShowMessage('Twain no está instalado');
DelphiTwain1.LibraryLoaded := TRUE;
DelphiTwain1.SourceManagerLoaded := TRUE;
if DelphiTwain1.LibraryLoaded = FALSE then Exit;
if DelphiTwain1.SourceCount = 0 then exit;
DelphiTwain1.Source[0].TransferMode := ttmMemory;
DelphiTwain1.Source[0].Loaded := TRUE;
DelphiTwain1.Source[0].Enabled := TRUE;
end;
En el Twain1TwainAcquire
Código Delphi
[-]
procedure TNTFormCompras.DelphiTwain1TwainAcquire(Sender: TObject;
const Index: Integer; Image: TBitmap; var Cancel: Boolean);
var
Bmp: TBitmap;
sAux: String;
Jpg: TJpegImage;
begin
inherited;
Bmp:=TBitmap.Create;
Bmp.Assign(Image);
Cancel := TRUE;
sAux:=DlgPropiedades.DirectorioImagenes + '\' + Tabla.TableName+'_'+Tabla.FieldByname('CODIGO').AsString+'.jpg';
JPG:=TJpegImage.Create;
JPG.Assign(BMP);
jpg.SaveToFile(sAux);
end;
Espero que te sirva de algo.
Saludos