Home › Forums › TWAIN Classic › TW_RANGE
- This topic has 6 replies, 3 voices, and was last updated 11 years, 3 months ago by si_ben.
- AuthorPosts
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 :150When 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..
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…
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…
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
Okay well that helps, now i just need to know how to interpret that in VB code 🙂 Thanks for the pointer!!
VB6 or .NET?
.NET 3.5 (Using Visual Studio 2008 Pro)
- AuthorPosts