|
Available in the LEADTOOLS Imaging toolkit. |
FindFastConfig Example for C++ 5.0 and later
void CRasterTwainSink::OnFastConfigEvent(ILTFastConfig_U * pltResConfig) { // ... set your code here . . . . m_pView->m_pltRasTwain->StopFindFastConfig = FALSE; } void CTwainView::OnTwainAcquire() { short iRet; CString csStr; m_pltRasTwain->EnableFastConfigEvent = TRUE; m_pltRasTwain->UserFastConfigsCount = 2; m_pltRasTwain->UserFastConfigs[0]->TransferMode = L_LTWAIN_FILE_MODE; m_pltRasTwain->UserFastConfigs[0]->FileFormat = FILE_BMP; m_pltRasTwain->UserFastConfigs[0]->BitsPerPixel = 1; m_pltRasTwain->UserFastConfigs[1]->TransferMode = L_LTWAIN_FILE_MODE; m_pltRasTwain->UserFastConfigs[1]->FileFormat = FILE_TIF; m_pltRasTwain->UserFastConfigs[1]->BitsPerPixel = 1; iRet = m_pltRasTwain->FindFastConfig("c:\\Twain", L_LTWAIN_SHOW_USER_INTERFACE, 1, 1); if (iRet == 0) { MessageBox(TEXT("FindFastConfig method was successful"), TEXT("Notice"), MB_OK); csStr.Format(TEXT("Resulting Scan Configs count = %d"), m_pltRasTwain->FastConfigsResultCount); MessageBox(csStr, TEXT("Notice"), MB_OK); csStr.Empty(); csStr.Format(TEXT("Transfer Mode = %d\nFile Format = %d\nBuffer Size = %d\nRequired Time = %d\n"), m_pltRasTwain->FastConfigsResult[0]->TransferMode, m_pltRasTwain->FastConfigsResult[0]->FileFormat, m_pltRasTwain->FastConfigsResult[0]->BufferSize, m_pltRasTwain->FastConfigsResult[0]->RequiredTime); MessageBox(csStr, TEXT("Resulting Scan Configurations..."), MB_OK); csStr.Empty(); csStr.Format(TEXT("Transfer Mode = %d\nFile Format = %d\nBuffer Size = %d\nRequired Time = %d\n"), m_pltRasTwain->BestFastConfig->TransferMode, m_pltRasTwain->BestFastConfig->FileFormat, m_pltRasTwain->BestFastConfig->BufferSize, m_pltRasTwain->BestFastConfig->RequiredTime); MessageBox(csStr, TEXT("Resulting Scan Configurations..."), MB_OK); } else MessageBox(TEXT("Error occurred in the FindFastConfig method!!!"), TEXT("Error!!!"), MB_OK); }