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

TW_RANGE

Forums › TWAIN Classic › TW_RANGE

  • This topic has 6 replies, 3 voices, and was last updated 8 years ago by si_ben.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • August 3, 2012 at 8:12 pm #22770 Reply
    si_ben
    Participant
    • Topics - 7
    • Replies - 22
    • Total Posts - 29

    Okay so I have gotten farther in my code thanks to the help of some guys on here but Im calling on your help again.

    I know that most of you all code in C# but im hoping I can get some insight on some of the values that I retrieve from my RANGE type capabilities.

    Example:

    When I call a get on X/YResolution I get the results :

    Min :12
    Max :1600
    Increment :1
    Current :150
    Default :150

    When I call X/YScaling I get the results :

    Min: 429457408
    Max: 4
    Increment: 429457408
    Current: 1
    Default: 1
    _________________________________________
    They are of the ItemType.Fix32 :: Okay.. So I need to do some conversion to these numbers?

    In the book it specifies : A value of ‘1.0’ is equivalent to 100% scaling. Do not use
    values less than or equal to zero.

    Im totally lost somewhere..

    August 5, 2012 at 12:15 pm #25662 Reply
    MarkM
    Participant
    • Topics - 1
    • Replies - 135
    • Total Posts - 136

    It looks like a bug in the driver. Mapping the values you supplied (converting to hex) we find…

    typedef struct {
    TW_UINT16 ItemType; ????
    TW_UINT32 MinValue; 1999 0000
    TW_UINT32 MaxValue; 0000 0004
    TW_UINT32 StepSize; 1999 0000
    TW_UINT32 DefaultValue; 0000 0001
    TW_UINT32 CurrentValue; 0000 0001
    } TW_RANGE, FAR * pTW_RANGE;

    4, 1 and 1 look like reasonable values. 0x1999 is 6553 decimal, this looks suspiciously like 6553x / 10. 65535 would be the max for the Frac field in TW_FIX32. So I suspect that MinValue and StepSize should be reporting 0000 0001.

    Contact the scanner vendor for help…

    August 7, 2012 at 4:11 pm #25663 Reply
    si_ben
    Participant
    • Topics - 7
    • Replies - 22
    • Total Posts - 29

    That makes a lot of sense thank you. The step size and min size of 1 are something I thought it should be reporting as well…

    August 7, 2012 at 8:30 pm #25664 Reply
    MSM
    Participant
    • Topics - 0
    • Replies - 29
    • Total Posts - 29

    I believe you see 1999 0000 because of the FIX32 structure is casted directly to INT32. It Whole=0, Frac=0x1999. It means the min and the step are 0.1= 0x1999/0x10000

    August 8, 2012 at 3:50 pm #25665 Reply
    si_ben
    Participant
    • Topics - 7
    • Replies - 22
    • Total Posts - 29

    Okay well that helps, now i just need to know how to interpret that in VB code 🙂 Thanks for the pointer!!

    August 8, 2012 at 11:04 pm #25666 Reply
    MSM
    Participant
    • Topics - 0
    • Replies - 29
    • Total Posts - 29

    VB6 or .NET?

    December 28, 2012 at 5:06 pm #25667 Reply
    si_ben
    Participant
    • Topics - 7
    • Replies - 22
    • Total Posts - 29

    .NET 3.5 (Using Visual Studio 2008 Pro)

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: TW_RANGE
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.