ISISAcquireMulti example for C++Builder 4.0
/* The following example prepares for scanning multiple images by setting tags */
/* and enabling the OnISISPage event and then scans multiple images using */
/* ISISAcquireMulti method. */
void __fastcall TForm1::AcquireMulti1Click(TObject *Sender)
{
int nMaxPages = 10, nRet;
AnsiString ErrorDesc;
LeadIsis1->EnableMethodErrors = False;
LeadIsis1->EnableISISEvent = True;
nRet = LeadIsis1->ISISLoadDriver();
if(nRet == SUCCESS)
{
LeadIsis1->ISISSetTag(TAG_SCANAHEAD, TAG_SCANAHEAD_YES);
LeadIsis1->ISISGetTag(TAG_MAXPAGES, nMaxPages);
LeadIsis1->ISISSetTag(TAG_SCANAHEAD_MAXPAGES, nMaxPages / 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)
if(nRet == ERROR_USER_ABORT)
ShowMessage("Acquire canceled, " + IntToStr(LeadIsis1->PagesDiscarded) + " pages were aborted!");
else
{
if(nRet != ERROR_ISIS_CANCEL)
ShowMessage("Error " + IntToStr(nRet) + " during ISIS Scan!\n" + ErrorDesc);
}
else
ShowMessage("Image(s) acquired to file(s) c:\\temp\\dTest.tif");
}
}
void __fastcall TForm1::LeadIsis1ISISPage(TObject *Sender, int nPage, AnsiString FileName)
{
Label1->Caption = IntToStr(nPage);
Label1->Refresh();
Label2->Caption = FileName;
Label2->Refresh();
}