Home › Forums › TWAIN Classic › ICAP_PIXELFLAVOR = TWPF_VANILLA will make scanner slow.
- This topic has 1 reply, 2 voices, and was last updated 10 years, 8 months ago by Kaij.
- AuthorPosts
When I set the ICAP_PIXELFLAVOR value to TWPF_VANILLA, this will make the scanner performance very slow. But TWPF_CHOCOLATE will scan the document at normal rate. Here is my code for your reference. Please suggest why this will make scanner slow.
// Set Pixel type
twCap.Cap = ICAP_PIXELTYPE;
twCap.ConType = TWON_ONEVALUE;
pval->ItemType = TWTY_UINT16;
pval->Item = (TW_UINT32)TWPT_BW; //TWPT_BW, TWPT_GRAY, TWPT_RGB
CallTwainProc(&m_AppId,&m_Source,DG_CONTROL,DAT_CAPABILITY,MSG_SET,(TW_MEMREF)&twCap);// Set pixel flavor
twCap.Cap = ICAP_PIXELFLAVOR;
twCap.ConType = TWON_ONEVALUE;
pval->ItemType = TWTY_UINT16;
pval->Item = TWPF_CHOCOLATE; //TWPF_CHOCOLATE, TWPF_VANILLA
CallTwainProc(&m_AppId,&m_Source,DG_CONTROL,DAT_CAPABILITY,MSG_SET,(TW_MEMREF)&twCap);// Set Bit depth
twCap.Cap = ICAP_BITDEPTH;
twCap.ConType = TWON_ONEVALUE;
pval->ItemType = TWTY_UINT16;
pval->Item = (TW_UINT32)1; //8
CallTwainProc(&m_AppId,&m_Source,DG_CONTROL,DAT_CAPABILITY,MSG_SET (TW_MEMREF)&twCap);//Set Threshold
twCap.Cap = ICAP_THRESHOLD;
twCap.ConType = TWON_ONEVALUE;
pval->ItemType = TWTY_FIX32;
v32.Whole = 255;
v32.Frac = 0;
pval->Item = *((TW_UINT32 *)&v32);
CallTwainProc(&m_AppId,&m_Source,DG_CONTROL,DAT_CAPABILITY,MSG_SET,(TW_MEMREF)&twCap);Thanks,
Yoga VYoga,
Your code looks fine at the first view. Have you checked that with different scanner models
to exclude a strange inversion routine in a particular Data Source?I also suggest to check if the value of ICAP_THRESHOLD has any impact.
I hope that answers your question.
Best regards,
KaijOEM TWAIN drivers and toolkits from http://www.jse.de
- AuthorPosts