/* Trasnfers the image or cancels the transfer depending on the state of the TWAIN system */ void CTwain::TransferImage() { TW_IMAGEINFO info; BOOL bContinue=TRUE; while(bContinue) { if(GetImageInfo(info)) { int permission; permission = ShouldTransfer(info); switch(permission) { case TWCPP_CANCELTHIS: bContinue=EndTransfer(); break; case TWCPP_CANCELALL: CancelTransfer(); bContinue=FALSE; break; case TWCPP_DOTRANSFER: bContinue=GetImage(info); break; } } } }
/** Transfers the image or cancels the transfer depending on the state of the TWAIN system */ void TwainIface::TransferImage() { TW_IMAGEINFO info; bool bContinue=true; while(bContinue) { if(GetImageInfo(info)) { int permission = ShouldTransfer(info); switch(permission) { case TWCPP_CANCELTHIS: bContinue=EndTransfer(); break; case TWCPP_CANCELALL: CancelTransfer(); bContinue=false; break; case TWCPP_DOTRANSFER: bContinue=GetImage(info); break; } } } }
/* Trasnfers the image or cancels the transfer depending on the state of the TWAIN system */ void CTwain::TransferImage() { TW_IMAGEINFO info; BOOL bContinue = TRUE; int nScanStatus = 0; //扫描结束时状态,1--正常扫描结束 TRACE("********** TransferImage ************\n"); while(bContinue) { if (GetImageInfo(info) && _bTwainContinue) //GetImageInfo(info) { int permission; permission = ShouldTransfer(info); switch(permission) { case TWCPP_CANCELTHIS: TRACE("************ TransferImage--> TWCPP_CANCELTHIS. 1 ************\n"); bContinue=EndTransfer(); nScanStatus = -1; TRACE("************ TransferImage--> TWCPP_CANCELTHIS.2 ************\n"); break; case TWCPP_CANCELALL: TRACE("************ TransferImage--> TWCPP_CANCELALL. 1 ************\n"); CancelTransfer(); bContinue=FALSE; nScanStatus = -2; TRACE("************ TransferImage--> TWCPP_CANCELALL. 2 ************\n"); break; case TWCPP_DOTRANSFER: TRACE("********** TransferImage --> TWCPP_DOTRANSFER ************\n"); bContinue=GetImage(info); if (!_bHasNextPic) nScanStatus = 1; else nScanStatus = 2; break; default: TRACE("************ TransferImage--> default. ************\n"); bContinue = FALSE; nScanStatus = -3; break; } } else { TRACE("************ TransferImage --> GetImageInfo failed or m_bContinue = false *************\n"); nScanStatus = -4; EndTransfer(); bContinue = FALSE; } } TRACE("******* 扫描完成 ***********\n"); ScanDone(nScanStatus); }