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

ICAP_XRESOLUTION rare values

Forums › TWAIN Classic › ICAP_XRESOLUTION rare values

  • This topic has 3 replies, 2 voices, and was last updated 12 years, 7 months ago by june5.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • May 30, 2008 at 8:15 am #22351 Reply
    smoreno
    Participant
    • Topics - 2
    • Replies - 1
    • Total Posts - 3

    Hello, I´m Sergio from Spain. I´m making a program which manage twain driver for scanning. I have got the following code:

    twCapability.Cap=ICAP_XRESOLUTION;
    twCapability.ConType=TWON_DONTCARE16;
    twCapability.hContainer=GlobalAlloc(GHND,sizeof(TW_RANGE));

    Rc=(*pDSM_Entry) ((TW_IDENTITY*)MainIdentity,(TW_IDENTITY*)&SourceIdentity,DG_CONTROL,DAT_CAPABILITY,MSG_GET,(TW_MEMREF)&twCapability);

    if(Rc==TWRC_SUCCESS)
    {
    TW_RANGE pRange=(pTW_RANGE)GlobalLock(twCapability.hContainer);

    if ((TW_UINT16)pRange->ItemType == TWTY_FIX32)
    {
    //Store Item Value
    pTWFix32 = &(pRange->MaxValue);
    valueF32 = FIX32ToFloat(*pTWFix32);
    MaxResolution = valueF32;

    pTWFix32 = &(pRange->MinValue);
    valueF32 = FIX32ToFloat(*pTWFix32);
    MinResolution = valueF32;
    }

    GlobalUnlock(twCapability.hContainer);
    }

    When I test it with a Fujitsu fi-4010CU, I obtain correct values such as pRange->MaxValue = 600, pRange->MinValue = 50, pRange->StepSize = 1, pRange->DefaultValue = 300. But when I test the same with a Canon DR2050C, I obtain this: pRange->MaxValue = 4, pRange->MinValue = 7, pRange->StepSize = 4, pRange->DefaultValue = 100, pRange->CurrentValue = 150.

    I also have been proving with twCapability.ConType= TWON_RANGE, TWON_ENUMERATION, TWON_ONEVALUE but the results have been the same.

    I don’t know how to interpret Canon DR2050C values because the maximun resolution is 600×600 dpi and not 4×4 dpi. I also don’t know if these values are correct or incorrect.

    Thank you for your assistance.

    May 30, 2008 at 11:17 am #24531 Reply
    june5
    Participant
    • Topics - 0
    • Replies - 17
    • Total Posts - 17

    In case of DR2050C, ConType is TWON_ENUMERATION.

    > pRange->MaxValue = 4, pRange->MinValue = 7, pRange->StepSize = 4

    It means NumItems=7, CurrentIndex=4, DefaultIndex=4. You can get 7 items, I think.

    June 2, 2008 at 11:39 am #24532 Reply
    smoreno
    Participant
    • Topics - 2
    • Replies - 1
    • Total Posts - 3

    Thank you very much for your reply. Now, I know how to obtain all the possible resolution values of my scanner from TW_ENUMERATION struct.

    I also have got another doubt. Trying to do my application more general and wanting it works with a large amount of scanners, I´d like to know if there is a way or a mechanism to know in which type of capability structure (TW_RANGE, TW_ENNUMERATION…) one scanner returns me its capability values. If I know this information I will be able to know in which structure I should look for the values I want.

    Thanks.

    😉

    June 2, 2008 at 12:53 pm #24533 Reply
    june5
    Participant
    • Topics - 0
    • Replies - 17
    • Total Posts - 17

    Check twCapability.ConType returned by the driver. If it is TWON_RANGE, you need to cast hContainer into pTW_RANGE; if TWON_ENUMERATION, into pTW_ENUMERATION.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: ICAP_XRESOLUTION rare values
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

  • Big Ass Photos – Free Huge Butt Porn, Big Booty Pics
  • 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.
  • 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.