saraff-9EB1047A4BEB4cef8506B29BA325BD5A / Saraff.Twain.NET

Saraff.Twain.NET is the skillful scanning component which allows you to control work of flatbed scanner, web and digital camera and any other TWAIN device from .NET environment. You can use this library in your programs written in any programming languages compatible with .NET technology.
GNU General Public License v3.0
102 stars 35 forks source link

CAP_CUSTOMDSDATA set custom data #90

Closed ghost closed 2 years ago

ghost commented 2 years ago

Hello,

I try so set custom data with capability here

The goal is with parameter, transfer custom data to the scanner with this parameters TwDG.Control, TwDAT.CustomDSData, TwMSG, TW_CUSTOMDSDATA).

Is it possible with the framework ?

Thanks in adavance !!

saraff-9EB1047A4BEB4cef8506B29BA325BD5A commented 2 years ago

Hello, @hilmoinb In the 8ce48f446c92faef8124349e5c5d8d0e95c0ae59 commit, I implemented this. Try to build from source and check. If successful, I will publish the nuget package.

if(_twain32.Capabilities.CustomDSData.GetCurrent()) {
    _twain32.CustomData = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 8 };
    var _data = _twain32.CustomData;
}
ghost commented 2 years ago

Ok how can i test with build please ? I usualy import the version by nuget package

saraff-9EB1047A4BEB4cef8506B29BA325BD5A commented 2 years ago

download zip-archive from github unpack in vs add exist project to your solution add reference in your project (you must remove the nuget-package before)

ghost commented 2 years ago

Sorry i'm late to awnser, i tested it yesterday night and it's ok after a quick fix : twain32.cs TwRC _rc = this._dsmEntry.DsInvoke(this._AppId, this._srcds, TwDG.Control, TwDAT.CustomDSData, TwMSG.Get, ref _data); replace by TwRC _rc = this._dsmEntry.DsInvoke(this._AppId, this._srcds, TwDG.Control, TwDAT.CustomDSData, TwMSG.Set, ref _data);

saraff-9EB1047A4BEB4cef8506B29BA325BD5A commented 2 years ago

Hello, @Nilsolen I made some changes, see 172e8ed3f48d721309eaf89beefe1e226f0138df and 666488bf98a642c6102c8f6ebf6ea4dafb0dc741 The package has publushed, see https://www.nuget.org/packages/Saraff.Twain/1.0.31.729

ghost commented 2 years ago

Thank you !