ISISAcquireMulti example for Delphi
{ The following example prepares for scanning multiple images by setting tags }
{ and enabling the OnISISPage event and then scans multiple images using }
{ ISISAcquireMulti method. }
var
nMaxPages : Integer;
nRet : Integer;
ErrorDesc : String;
begin
nMaxPages := 10;
LeadIsis1.EnableMethodErrors := False;
LeadIsis1.EnableISISEvent := True;
nRet := LeadIsis1.ISISLoadDriver();
If nRet = SUCCESS Then
begin
LeadIsis1.ISISSetTag(TAG_SCANAHEAD, TAG_SCANAHEAD_YES);
LeadIsis1.ISISGetTag(TAG_MAXPAGES, nMaxPages);
LeadIsis1.ISISSetTag(TAG_SCANAHEAD_MAXPAGES, nMaxPages div 2);
LeadIsis1.ISISSetTag(TAG_COMPRESSION, TAG_COMPRESSION_G4);
nRet := LeadIsis1.ISISAcquireMulti('c:\temp\dTest.tif', ISIS_SHOWUI, FILE_CCITT_GROUP4, True);
ErrorDesc := LeadIsis1.ErrorMsg;
LeadIsis1.ISISUnloadDriver();
If nRet <> SUCCESS Then
If nRet = ERROR_USER_ABORT Then
ShowMessage('Acquire canceled, ' + IntToStr(LeadIsis1.PagesDiscarded) + ' pages were aborted!')
Else
begin
If nRet <> ERROR_ISIS_CANCEL Then
ShowMessage('Error ' + IntToStr(nRet) + ' during ISIS Scan!' + #10 + ErrorDesc);
End
Else
ShowMessage('Image(s) acquired to file(s) c:\temp\dTest.tif');
end;
end;
procedure TForm1.LeadIsis1ISISPage(Sender: TObject; nPage: Integer; FileName: String);
begin
Label1.Caption := IntToStr(nPage);
Label1.Refresh;
Label2.Caption := FileName;
Label2.Refresh;
end;