twaindotnet
twaindotnet copied to clipboard
Correct way to set capability gamma?
I try to get and set gamma capability for my DS. I use:
int gamma = 10;
var cap = new Capability(Capabilities.Gamma, TwainType.Fix32, _applicationId, SourceId);
var basicCapResult = cap.GetBasicValueCurrent();
if (gamma != basicCapResult.Int32Value)
Capability.SetBasicCapability(Capabilities.Gamma, gamma, TwainType.Fix32, _applicationId, SourceId);
The value of current capability is always 858980354
, and setting the value will fail. Twain32Native.DsCapability()
throws an exception at protected void SetValue<T>(T value)
in Capability.cs.
Any suggestions?
Getting and setting capabilities isn't implemented the right way in the master branch; and it seems the author isn't actively maintaining the code base.
I implemented reading capabilities with container types of onevalue/enumeration/range/array in my own branch https://github.com/Mark1975/twaindotnet/tree/MemoryTransfer.
I hope this helps...