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

Reply To: ICAP_BRIGHTNESS

Forums › TWAIN Classic › ICAP_BRIGHTNESS › Reply To: ICAP_BRIGHTNESS

March 18, 2008 at 8:42 am #24410
kornjaca
Participant
  • Topics - 1
  • Replies - 5
  • Total Posts - 6

@gabe wrote:

if you are using the source code from codeproject as-is (at least as-is from the last time I checked it) there is a problem with NetMaster’s twCapability ctor. He assumes in his sample a static baseAddress size where he should have either calcualted the baseAddress size based on the ItemType or assumed a slightly larger baseAddress size. The result is that FIX32 types don’t work. It’s i nthe forumn comments on tha pag.

Gabe, thank you for your quick reply. I added another contructor like this:

public TwCapability(TwCap cap, TwFix32 val)
{
Cap = (short)cap;
ConType = (short)TwOn.One;
Handle = Twain.GlobalAlloc(0x42, 6);
IntPtr pv = Twain.GlobalLock(Handle);
Marshal.WriteInt16(pv, 0, (short)TwType.Fix32);
Marshal.WriteInt16(pv, 2, val.Whole);
if (val.Frac > Int16.MaxValue)
{
Marshal.WriteInt16(pv, 4, Convert.ToInt16(val.Frac – 32768));
}
else
{
Marshal.WriteInt16(pv, 4, Convert.ToInt16(val.Frac));
}
Twain.GlobalUnlock(Handle);
}

And I believe my Fix32 value is correctly passed into TWAIN Data Source since i get Success status, and also when I after that ask data source for it’s value, it returns me the same value I set. The problem is that GUI doesn’t reflect negotiated capabilities. Any ideas?

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