Home › Forums › TWAIN Classic › 4 – Bit Depth Cap is not set while in TWSX_MEMORY mode.
- This topic has 3 replies, 2 voices, and was last updated 10 years, 9 months ago by Catherine Sea.
- AuthorPosts
I am trying to transfer the image in Memory mode. I need the image should be transferred in 4 bit gray scale. Even I have set the below Cap’s I am getting 8 bit gray scale bmp image. I m using XP SP3 OS, Scanner Model – fi-5120C FUJITSU.
//set image transfer mode – ICAP_XFERMECH
twCap.Cap = ICAP_XFERMECH;
twCap.ConType = TWON_ONEVALUE;
pval->ItemType = TWTY_UINT16;
pval->Item = TWSX_MEMORY; //TWSX_FILE, TWSX_MEMORY
CallTwainProc(&m_AppId,&m_Source,DG_CONTROL,DAT_CAPABILITY,MSG_SET,(TW_MEMREF)&twCap);twCap.Cap = ICAP_PIXELTYPE;
// Set Pixel Type
twCap.ConType = TWON_ONEVALUE;
pval->ItemType = TWTY_UINT16;
pval->Item = (TW_UINT32)TWPT_GRAY; //TWPT_BW, TWPT_GRAY, TWPT_RGB
rc = 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)4; //8
rc = CallTwainProc(&m_AppId,&m_Source,DG_CONTROL,DAT_CAPABILITY,MSG_SET,(TW_MEMREF)&twCap);Please Suggest.
Thanks,
Kannan G.Hi Kannan,
It’s possible that your scanner’s TWAIN driver doesn’t support 4 bit gray scale. You may check the returned message to verify.
Thanks,
Catherine Sea
http://www.dynamsoft.comHi Catherine,
I have tested with Twacker it could scan the image in 4-bit grayscale bmp. But when I test with my application using mentioned capabilities it does not give expected 4-bit grayscale. I also checked return code status by setting and getting the capability in my application, It’s return TWRC_SUCCESS. But when I get image info after setting capabilities the bitsperpixel is still in 8.
I am using TwainDSM.dll(2.1).
Thanks
KannanHi Kannan,
If it works with Twacker, then you can debug with the source code of TWAIN app to see how it works.
http://sourceforge.net/projects/twain-samples/Thanks,
Catherine Sea
http://www.dynamsoft.com- AuthorPosts