ISISAcquireMulti example for C++ 5.0 and later
ISISTagValueConstants nMaxPages;
ILEADRasterISIS *pRasterISIS;
ILEADRaster *pRaster;
CWnd *m_pMainWnd;
short nRet;
//The following example prepares for scanning multiple images by setting tags and enabling the ISISPage event and then scans multiple images, using ISISAcquireMulti method.
nMaxPages = (ISISTagValueConstants)10;
pRasterISIS->PutEnableMethodErrors (FALSE);
pRasterISIS->PutEnableISISEvent (TRUE);
nRet = pRasterISIS->ISISLoadDriver ();
if (nRet == 0)
{
pRasterISIS->ISISSetTag (TAG_SCANAHEAD, TAG_SCANAHEAD_YES);
pRasterISIS->ISISGetTag (TAG_MAXPAGES);
NMaxPages = pRasterISIS->GetISISTagValue();
pRasterISIS->ISISSetTag(TAG_SCANAHEAD_MAXPAGES, ISISTagValueConstants((short)nMaxPages / 2));
pRasterISIS->ISISSetTag(TAG_COMPRESSION, TAG_COMPRESSION_G4);
nRet = pRasterISIS->ISISAcquireMulti ((long)m_pMainWnd->m_hWnd, pRaster, "d:\\temp\\mfctest.tif", ISIS_SHOWUI, FILE_CCITT_GROUP4, TRUE, ISIS_BITMAP_LIST_OVERWRITE );
pRasterISIS->ISISUnloadDriver ();
if (nRet != 0)
{
if (nRet == ERROR_USER_ABORT)
{
CString csMsg;
csMsg.Format(TEXT("Acquire canceled, %d pages were aborted!\n"),
pRasterISIS->GetPagesDiscarded () );
AfxMessageBox(csMsg);
}
else if (nRet != ERROR_ISIS_CANCEL)
AfxMessageBox(TEXT("Error During ISIS Scan"));
}
else
AfxMessageBox(TEXT("Image(s) acquired to file(s) d:\\temp\\mfctest.tif"));
}