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

Re: Re: Error in setting ICAP_BITDEPTHREDUCTION

Forums › TWAIN Classic › Error in setting ICAP_BITDEPTHREDUCTION › Re: Re: Error in setting ICAP_BITDEPTHREDUCTION

May 11, 2007 at 10:10 am #23779
albertmaxim
Participant
  • Topics - 2
  • Replies - 3
  • Total Posts - 5

@albertmaxim wrote:

Hi,

I am able to set the capability ICAP_BITDEPTHREDUCTION when using the scanner like HP Commericial Scanjet 5590 Twain
and Hp PSC1410 All-in-one series. But when using Canon scanner canoscan LIDE70, i am not able to set the capability ICAP_BITDEPTHREDUCTION

I am getting the error while setting the Mode [mode is either black & white or gray scale or color].
Please find the sample piece of code to set mode for the selected source / scanner.

BOOL ret_value = FALSE;
TW_CAPABILITY twCapability;
TW_UINT32 NumberOfItems;
pTW_ENUMERATION pvalEnum;
twCapability.Cap = ICAP_PIXELTYPE;
twCapability.ConType = TWON_ENUMERATION;//TWON_ONEVALUE, TWON_RANGE, TWON_ENUMERATION or TWON_ARRAY
NumberOfItems = 1;
twCapability.hContainer = GlobalAlloc(GHND,(sizeof(TW_ENUMERATION) + sizeof(TW_UINT16) * (NumberOfItems)));
if(twCapability.hContainer)
{
pvalEnum = (pTW_ENUMERATION)GlobalLock(twCapability.hContainer);
pvalEnum->NumItems = (TW_UINT32)NumberOfItems;
pvalEnum->ItemType = TWTY_UINT16;
pvalEnum->ItemList[0] = TWPT_BW;
pvalEnum->CurrentIndex = 0;
pvalEnum->DefaultIndex = TWON_DONTCARE32;
GlobalUnlock(twCapability.hContainer);
ret_value=SetCapability(twCapability);
GlobalFree(twCapability.hContainer);

if(ret_value)
{
twCapability.Cap = ICAP_BITDEPTHREDUCTION;
twCapability.ConType = TWON_ONEVALUE;
pTW_ONEVALUE pVal;

twCapability.hContainer = GlobalAlloc(GHND,sizeof(TW_ONEVALUE));
if(twCapability.hContainer)
{
pVal = (pTW_ONEVALUE)GlobalLock(twCapability.hContainer);
pVal->ItemType = TWTY_UINT16;
pVal->Item = TWBR_THRESHOLD;
GlobalUnlock(twCapability.hContainer);
ret_value = SetCapability(twCapability);
GlobalFree(twCapability.hContainer);
}
return ret_value;
}
}//end of if (twCap.hContainer)

Please provide me a solution for this error.

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