Home › Forums › TWAIN Classic › How to set Sensitivity of AutoDiscardBlankPage function ?
- This topic has 2 replies, 2 voices, and was last updated 9 years, 1 month ago by rufree.
- AuthorPosts
My Project must to implement AutoDiscardBlankPage function to Fujitsu Scanner fi-6670 with C++ language
So,It works correctly but It refers sensitivity value in ScanAllPro Program
Even if ScanAllPro set sensitivity = 0 , my function (AutoDiscardBlankPage) doesn’t skip blank page .
I need to know how to use Twain Library for set sensitivity of AutoDiscardBlankPage function with C++ ?Thanks for all the Suggestions ^^”
(Sorry for my english skill)this my code
BOOL CMyTwainDlg::TWAIN_UTIL_SetAutoDiscardBlankPages(BOOL bEnabled,int check)
{TW_CAPABILITY twDPI;
pTW_ONEVALUE ptwOneVal;
BOOL ret = FALSE;if(DSOpen() || OpenSource())
{
twDPI.Cap = ICAP_AUTODISCARDBLANKPAGES;
twDPI.ConType = TWON_ONEVALUE;if(check == 1){
twDPI.hContainer = GlobalAlloc(GHND, sizeof(TW_ONEVALUE));
ptwOneVal = (pTW_ONEVALUE) GlobalLock(twDPI.hContainer);
ptwOneVal->ItemType = TWTY_INT32;
ptwOneVal->Item = (TW_UINT32)TWBP_AUTO;
ret = CallTwainProc(&m_AppId, &m_Source, DG_CONTROL, DAT_CAPABILITY, MSG_SET,(TW_MEMREF)&twDPI);
GlobalUnlock(twDPI.hContainer);
GlobalFree(twDPI.hContainer);
}else {
twDPI.hContainer = GlobalAlloc(GHND, sizeof(TW_ONEVALUE));
ptwOneVal = (pTW_ONEVALUE) GlobalLock(twDPI.hContainer);
ptwOneVal->ItemType = TWTY_INT32;
//ptwOneVal->ItemType = 2;
ptwOneVal->Item = (TW_UINT32)TWBP_DISABLE;
ret = CallTwainProc(&m_AppId, &m_Source, DG_CONTROL, DAT_CAPABILITY, MSG_RESET,(TW_MEMREF)&twDPI);
GlobalUnlock(twDPI.hContainer);
GlobalFree(twDPI.hContainer);
}}
return ret;
}You may want to adjust the settings of Blank Image Threshold and Blank Image MaxStdDev. This kb article might help.
The two properties are from Dynamic Web TWAIN. You should be find the corresponding capabilities in TWAIN Specification.
If I used ICAP_THRESHOLD , So I must to scan in Blank&White mode only , right ?
because I read Twain’s manual (2.3)
Description
Specifies the dividing line between black and white. This is the value the Source will use to
threshold, if needed, when ICAP_PIXELTYPE = TWPT_BW.but I need to use skipblankpages function in all of Pixeltype’s mode (ICAP_PIXELTYPE)
- AuthorPosts