twaindotnet icon indicating copy to clipboard operation
twaindotnet copied to clipboard

Correct way to set capability gamma?

Open Tennyleaz opened this issue 5 years ago • 1 comments

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?

Tennyleaz avatar Jun 27 '19 03:06 Tennyleaz

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...

Mark1975 avatar Sep 09 '19 07:09 Mark1975