TWAIN Working Group

Newsletter Signup
Donate
Help keep TWAIN free
  • About TWAIN
    • What’s New?
    • News
    • Events
    • Membership
    • Consider a Donation
    • Contact Us
  • Why TWAIN?
  • Developers
    • Driver Developer
    • Application Developer
    • TWAIN Features
    • Specification & Tools
    • Self Certification Process
  • Support Forums
  • Scanner End-User
  • Find Certified Drivers
    • Facebook
    • LinkedIn
    • Vimeo

4 – Bit Depth Cap is not set while in TWSX_MEMORY mode.

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 7 years, 6 months ago by Catherine Sea.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • July 1, 2013 at 2:19 pm #22861 Reply
    kannanprathesh
    Participant
    • Topics - 5
    • Replies - 1
    • Total Posts - 6

    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.

    July 2, 2013 at 6:25 am #25927 Reply
    Catherine Sea
    Participant
    • Topics - 0
    • Replies - 59
    • Total Posts - 59

    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.com

    July 2, 2013 at 10:33 am #25928 Reply
    kannanprathesh
    Participant
    • Topics - 5
    • Replies - 1
    • Total Posts - 6

    Hi 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
    Kannan

    July 4, 2013 at 6:29 am #25929 Reply
    Catherine Sea
    Participant
    • Topics - 0
    • Replies - 59
    • Total Posts - 59

    Hi 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

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: 4 – Bit Depth Cap is not set while in TWSX_MEMORY mode.
Your information:




Quick Links

Service Providers
TWAIN Support Forums
Membership
Contact Us
Privacy Policy

Newsletter Signup

TWAIN Working Group Family

TWAIN Working Group
TWAIN Direct®
TWAIN Resources
TWAIN Certified Drivers
PDF/raster

  • Facebook
  • GitHub
  • LinkedIn
  • Vimeo

Recent Topics

  • EPSON V600 TWAIN and WIA on Windows 10
  • When and how to use WaitForEvents command ?
  • Problem enumerating list of installed scanners in windows server 2012
  • Failed to create TWAIN progress! Error code is 1260.
  • To get the list of scanners from javascript client side (browser)
  • Quarterly Newsletter
  • TWAIN Working Group Membership
  • Logo Usage
  • TWAIN License
  • Contact Us
Privacy Policy • Privacy Tools • Copyright © 2021 TWAIN Working Group • by iHwy, LLC • Log in

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.