diff --git a/NTwain.sln b/NTwain.sln
index e9f450b..0bdcc02 100644
--- a/NTwain.sln
+++ b/NTwain.sln
@@ -7,6 +7,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_common", "_common", "{4CE0
ProjectSection(SolutionItems) = preProject
Build.cmd = Build.cmd
src\Directory.Build.props = src\Directory.Build.props
+ global.json = global.json
LICENSE.txt = LICENSE.txt
README.md = README.md
EndProjectSection
@@ -22,8 +23,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_twain-doc", "_twain-doc",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NTwain", "src\NTwain\NTwain.csproj", "{3C8A3CF9-A60D-4F21-B866-D291A7AABD4A}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NTwain-temp", "src\NTwain-temp\NTwain-temp.csproj", "{A7020B90-5CE4-43EF-A75D-5E1F9B501CAC}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinForm32", "samples\WinForm32\WinForm32.csproj", "{7792A94E-D0B4-440D-8BD5-CA1CA548782C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinForm64", "samples\WinForm64\WinForm64.csproj", "{C9666CB2-C9A6-48C8-AB51-D616A48058A7}"
@@ -38,8 +37,6 @@ Global
{3C8A3CF9-A60D-4F21-B866-D291A7AABD4A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3C8A3CF9-A60D-4F21-B866-D291A7AABD4A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3C8A3CF9-A60D-4F21-B866-D291A7AABD4A}.Release|Any CPU.Build.0 = Release|Any CPU
- {A7020B90-5CE4-43EF-A75D-5E1F9B501CAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A7020B90-5CE4-43EF-A75D-5E1F9B501CAC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7792A94E-D0B4-440D-8BD5-CA1CA548782C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7792A94E-D0B4-440D-8BD5-CA1CA548782C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7792A94E-D0B4-440D-8BD5-CA1CA548782C}.Release|Any CPU.ActiveCfg = Release|Any CPU
diff --git a/README.md b/README.md
index 8c96338..17f1e80 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@ the TWAIN Working Group.
V4 of this lib has these features:
-* Targets TWAIN version (2.5).
+* Targets TWAIN version 2.5.
* Runs under supported framework (4.6.2+) and netcore variants (6.0+).
* Easier to use than the low-level C API with many dotnet niceties.
* Attempt at reducing heap allocations compared to previous versions.
@@ -43,7 +43,7 @@ containers and values should be.
* All lower-level TWAIN APIs are public instead of hidden away.
* `TwainAppSession` longer hosts its own internal message pump. Apps will need to hook
-into their UI message loop on Windows (Winform and WPF at the moment).
+into their UI message loop on Windows (supports Winform and WPF at the moment).
## Using the lib
@@ -58,7 +58,6 @@ provided by this lib. A lower-level abstraction is the triplet calls
(under `NTwain.DSM` namespace).
You use `TwainAppSession` by subscribing to its events and calling methods to do TWAIN things.
-There is a sample winform projects (both 32 and 64 bit variants) on how it can be used.
+There is a sample winform project (both 32 and 64 bit variants) on how it can be used.
Note that an application process should only have one active (opened)
`TwainAppSession` at any time.
-
diff --git a/samples/Console32/Console32.csproj b/samples/Console32/Console32.csproj
deleted file mode 100644
index ed93de7..0000000
--- a/samples/Console32/Console32.csproj
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
- Exe
- net462;net7.0
- enable
- x86
- SampleConsole
- 11
-
-
-
-
-
-
-
diff --git a/samples/Console32/Program.cs b/samples/Console32/Program.cs
deleted file mode 100644
index 2733346..0000000
--- a/samples/Console32/Program.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using NTwain;
-using NTwain.Data;
-using System;
-using System.Diagnostics;
-using System.Reflection;
-
-namespace SampleConsole
-{
- internal class Program
- {
- // CONSOLE won't work yet until I got a message loop going.
-
- static void Main(string[] args)
- {
- TwainPlatform.PreferLegacyDSM = true;
-
- var twain = new TwainSession(new InPlaceMarshaller(), Assembly.GetExecutingAssembly().Location);
- twain.StateChanged += Twain_StateChanged;
-
- var hwnd = IntPtr.Zero; // required for windows
- var rc = twain.OpenDSM(hwnd);
- Debug.WriteLine($"OpenDSM={rc}");
-
- if (rc == STS.SUCCESS)
- {
- Debug.WriteLine($"CloseDSM={rc}");
- rc = twain.CloseDSM();
- }
- }
-
- private static void Twain_StateChanged(TwainSession session, STATE state)
- {
- Console.WriteLine($"State changed to {state}");
- }
- }
-}
\ No newline at end of file
diff --git a/samples/Net5Console/Net5Console.csproj b/samples/Net5Console/Net5Console.csproj
deleted file mode 100644
index c2ff29c..0000000
--- a/samples/Net5Console/Net5Console.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Exe
- net5.0
- x86
-
-
-
-
-
-
-
diff --git a/samples/Net5Console/Program.cs b/samples/Net5Console/Program.cs
deleted file mode 100644
index 08059d0..0000000
--- a/samples/Net5Console/Program.cs
+++ /dev/null
@@ -1,173 +0,0 @@
-using NTwain;
-using System;
-using System.Collections;
-using System.Linq;
-using System.Reflection;
-using System.Threading;
-using TWAINWorkingGroup;
-using static TWAINWorkingGroup.TWAIN;
-
-namespace Net5Console
-{
- class Program
- {
- [STAThread]
- static void Main()
- {
- Console.WriteLine("Starting twain test in console...");
- Console.WriteLine();
-
- using (var session = new TwainSession(Assembly.GetExecutingAssembly(), null, IntPtr.Zero))
- using (var hold = new ManualResetEventSlim())
- {
- session.DeviceEvent += (sender, e) =>
- {
- Console.WriteLine($"Got device event " + e.Event);
- Console.WriteLine();
- };
- session.TransferError += (sender, e) =>
- {
- Console.WriteLine($"Transfer error {e.Code} {e.Exception}.");
- };
- session.TransferReady += (sender, e) =>
- {
- Console.WriteLine($"Transfer ready, count={e.PendingCount}.");
- };
- session.SourceDisabled += (sender, e) =>
- {
- Console.WriteLine("Disabled device.");
- Console.WriteLine();
- hold.Set();
- };
-
- if (session.Open() == STS.SUCCESS)
- {
- Console.WriteLine("Opened DSM");
- Console.WriteLine();
-
- Console.WriteLine("Default device:");
- Console.WriteLine($"\t{session.DefaultDataSource}");
- Console.WriteLine();
-
- Console.WriteLine("All devices:");
- TW_IDENTITY? dsToUse = null;
- foreach (var dev in session.GetDataSources())
- {
- Console.WriteLine($"\t{dev}");
- if (dev.ProductName == "TWAIN2 Software Scanner")
- {
- dsToUse = dev;
- }
- }
- Console.WriteLine();
-
- if (!dsToUse.HasValue)
- {
- Console.WriteLine("Sample scanner not found.");
- }
- else
- {
- session.CurrentDataSource = dsToUse.Value;
- if (session.CurrentDataSource.HasValue)
- {
- Console.WriteLine("Current device after opening attempt:");
- Console.WriteLine($"\t{session.CurrentDataSource}");
- Console.WriteLine();
-
- var caps = session.Capabilities;
- Console.WriteLine("All device caps:");
- foreach (var cap in caps.CAP_SUPPORTEDCAPS.GetValues())
- {
- WriteCapInfo(caps, cap);
- }
- Console.WriteLine();
-
- short count = 3;
- var sts = caps.CAP_XFERCOUNT.SetOrConstraint(MSG.SET, count);
- if (sts == STS.SUCCESS)
- {
- Console.WriteLine($"Successfully set xfercount to {count}.");
- }
- else
- {
- Console.WriteLine($"Failed set xfercount: {sts}.");
- }
- Console.WriteLine();
-
-
- sts = caps.ICAP_PIXELTYPE.SetOrConstraint(MSG.SET, TWPT.GRAY);
- if (sts == STS.SUCCESS)
- {
- Console.WriteLine("Successfully set pixel type to GRAY.");
- }
- else
- {
- Console.WriteLine($"Failed set pixel type: {sts}.");
- }
- Console.WriteLine();
-
- sts = session.StartCapture(false);
- if (sts == STS.SUCCESS)
- {
- Console.Error.WriteLine("Waiting for capture to complete.");
- Console.WriteLine();
-
- while (!hold.IsSet) Thread.Sleep(100);
- }
- else
- {
- Console.Error.WriteLine("Failed to start capture: " + sts);
- Console.WriteLine();
- }
- }
- else
- {
- Console.WriteLine("No devices opened.");
- Console.WriteLine();
- }
- }
- }
- else
- {
- Console.Error.WriteLine("Failed to open DSM");
- }
- Console.WriteLine("Test Ended");
- }
-
- }
-
- private static void Session_SourceDisabled(object sender, EventArgs e)
- {
- throw new NotImplementedException();
- }
-
- private static void WriteCapInfo(Capabilities caps, CAP cap)
- {
- // use reflection due to unknown generics
- var propInfo = typeof(Capabilities).GetProperty(cap.ToString());
- if (propInfo == null) return;
-
- var capWrapper = propInfo.GetValue(caps);
- var wrapType = capWrapper.GetType();
- var label = (string)wrapType.GetMethod(nameof(CapWrapper.GetLabel)).Invoke(capWrapper, null);
- var supports = (TWQC)wrapType.GetMethod(nameof(CapWrapper.QuerySupport)).Invoke(capWrapper, null);
-
- Console.WriteLine($"\t{label ?? cap.ToString()}: {supports}");
- Console.WriteLine($"\t\tDefault: {wrapType.GetMethod(nameof(CapWrapper.GetDefault)).Invoke(capWrapper, null)}");
- Console.WriteLine($"\t\tCurrent: {wrapType.GetMethod(nameof(CapWrapper.GetCurrent)).Invoke(capWrapper, null)}");
- bool first = true;
- foreach (var val in (IEnumerable)wrapType.GetMethod(nameof(CapWrapper.GetValues)).Invoke(capWrapper, null))
- {
- if (first)
- {
- Console.WriteLine($"\t\tValues:\t{val}");
- first = false;
- }
- else
- {
- Console.WriteLine($"\t\t\t{val}");
- }
- }
- }
- }
-}
diff --git a/src/NTwain-temp/CapWrapper.cs b/src/NTwain-temp/CapWrapper.cs
deleted file mode 100644
index 430cc19..0000000
--- a/src/NTwain-temp/CapWrapper.cs
+++ /dev/null
@@ -1,305 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using TWAINWorkingGroup;
-using static TWAINWorkingGroup.TWAIN;
-
-namespace NTwain
-{
- ///
- /// Contains operations for a .
- ///
- /// Individual value type of the cap. Must be one of TWAIN's supported cap value types.
- /// You are responsible for using the correct type for a cap.
- public class CapWrapper where TValue : struct
- {
- protected readonly TWAIN _twain;
-
- public CapWrapper(TWAIN twain, CAP cap)
- {
- _twain = twain;
- Cap = cap;
- }
-
- ///
- /// The cap being targeted.
- ///
- public CAP Cap { get; }
-
- ///
- /// Gets the operations supported by the cap.
- /// Not all sources supports this so it may be unknown.
- ///
- public TWQC QuerySupport()
- {
- var twCap = new TW_CAPABILITY
- {
- Cap = Cap
- };
-
- var sts = _twain.DatCapability(DG.CONTROL, MSG.QUERYSUPPORT, ref twCap);
- if (sts == STS.SUCCESS && twCap.ConType == TWON.ONEVALUE)
- {
- return ValueReader.ReadOneValueContainer(_twain, ref twCap);
- }
- return TWQC.Unknown;
- }
-
- ///
- /// Try to get list of the cap's supported values.
- ///
- ///
- public IList GetValues()
- {
- var twCap = new TW_CAPABILITY
- {
- Cap = Cap
- };
-
- var sts = _twain.DatCapability(DG.CONTROL, MSG.GET, ref twCap);
- if (sts == STS.SUCCESS)
- {
- switch (twCap.ConType)
- {
- case TWON.ONEVALUE:
- return new[] { ValueReader.ReadOneValueContainer(_twain, ref twCap) };
- case TWON.ENUMERATION:
- return ValueReader.ReadEnumerationContainer(_twain, ref twCap).Items;
- case TWON.ARRAY:
- return ValueReader.ReadArrayContainer(_twain, ref twCap);
- case TWON.RANGE:
- return ValueReader.ReadRangeContainer(_twain, ref twCap).ToList();
- }
- }
- return EmptyArray.Value;
- }
-
- ///
- /// Try to get the cap's current value.
- ///
- ///
- public TValue GetCurrent()
- {
- var twCap = new TW_CAPABILITY
- {
- Cap = Cap
- };
-
- var sts = _twain.DatCapability(DG.CONTROL, MSG.GETCURRENT, ref twCap);
- if (sts == STS.SUCCESS)
- {
- switch (twCap.ConType)
- {
- case TWON.ONEVALUE:
- return ValueReader.ReadOneValueContainer(_twain, ref twCap);
- case TWON.ENUMERATION:
- var enumeration = ValueReader.ReadEnumerationContainer(_twain, ref twCap);
- if (enumeration.CurrentIndex < enumeration.Items.Length)
- return enumeration.Items[enumeration.CurrentIndex];
- break;
- case TWON.RANGE:
- return ValueReader.ReadRangeContainer(_twain, ref twCap).CurrentValue;
- }
- }
- return default;
- }
-
- ///
- /// Try to get the cap's default value.
- ///
- ///
- public TValue GetDefault()
- {
- var twCap = new TW_CAPABILITY
- {
- Cap = Cap
- };
-
- var sts = _twain.DatCapability(DG.CONTROL, MSG.GETDEFAULT, ref twCap);
- if (sts == STS.SUCCESS)
- {
- switch (twCap.ConType)
- {
- case TWON.ONEVALUE:
- return ValueReader.ReadOneValueContainer(_twain, ref twCap);
- case TWON.ENUMERATION:
- var enumeration = ValueReader.ReadEnumerationContainer(_twain, ref twCap);
- if (enumeration.DefaultIndex < enumeration.Items.Length)
- return enumeration.Items[enumeration.DefaultIndex];
- break;
- case TWON.RANGE:
- return ValueReader.ReadRangeContainer(_twain, ref twCap).DefaultValue;
- }
- }
- return default;
- }
-
- ///
- /// Try to get the cap's label text.
- ///
- ///
- public string GetLabel()
- {
- var twCap = new TW_CAPABILITY
- {
- Cap = Cap
- };
-
- var sts = _twain.DatCapability(DG.CONTROL, MSG.GETLABEL, ref twCap);
- if (sts == STS.SUCCESS)
- {
- return ValueReader.ReadOneValueContainerString(_twain, twCap);
- }
- return null;
- }
-
- ///
- /// Try to get the cap's description text.
- ///
- ///
- public string GetHelp()
- {
- var twCap = new TW_CAPABILITY
- {
- Cap = Cap
- };
-
- var sts = _twain.DatCapability(DG.CONTROL, MSG.GETHELP, ref twCap);
- if (sts == STS.SUCCESS)
- {
- return ValueReader.ReadOneValueContainerString(_twain, twCap);
- }
- return null;
- }
-
- ///
- /// Resets the cap's current value to power-on default.
- ///
- ///
- public STS Reset()
- {
- var twCap = new TW_CAPABILITY
- {
- Cap = Cap
- };
-
- var sts = _twain.DatCapability(DG.CONTROL, MSG.RESET, ref twCap);
- return sts;
- }
-
- ///
- /// Try to set a one value for the cap.
- ///
- ///
- ///
- ///
- public STS SetOrConstraint(MSG setMsg, TValue value)
- {
- if (setMsg != MSG.SET && setMsg != MSG.SETCONSTRAINT)
- throw new ArgumentException($"Only {nameof(MSG.SET)} and {nameof(MSG.SETCONSTRAINT)} messages are supported.", nameof(setMsg));
-
- var twCap = new TW_CAPABILITY
- {
- Cap = Cap,
- ConType = TWON.ONEVALUE
- };
- try
- {
- ValueWriter.WriteOneValueContainer(_twain, ref twCap, value);
- return _twain.DatCapability(DG.CONTROL, setMsg, ref twCap);
- }
- finally
- {
- if (twCap.hContainer != IntPtr.Zero)
- _twain.DsmMemFree(ref twCap.hContainer);
- }
- }
-
- ///
- /// Try to set an array value for the cap.
- ///
- ///
- ///
- ///
- public STS SetOrConstraint(MSG setMsg, TValue[] values)
- {
- if (setMsg != MSG.SET && setMsg != MSG.SETCONSTRAINT)
- throw new ArgumentException($"Only {nameof(MSG.SET)} and {nameof(MSG.SETCONSTRAINT)} messages are supported.", nameof(setMsg));
- if (values == null) throw new ArgumentNullException(nameof(values));
-
- var twCap = new TW_CAPABILITY
- {
- Cap = Cap,
- ConType = TWON.ARRAY
- };
- try
- {
- ValueWriter.WriteArrayContainer(_twain, ref twCap, values);
- return _twain.DatCapability(DG.CONTROL, setMsg, ref twCap);
- }
- finally
- {
- if (twCap.hContainer != IntPtr.Zero)
- _twain.DsmMemFree(ref twCap.hContainer);
- }
- }
-
- ///
- /// Try to set a range value for the cap.
- ///
- ///
- ///
- ///
- public STS SetOrConstraint(MSG setMsg, Range value)
- {
- if (setMsg != MSG.SET && setMsg != MSG.SETCONSTRAINT)
- throw new ArgumentException($"Only {nameof(MSG.SET)} and {nameof(MSG.SETCONSTRAINT)} messages are supported.", nameof(setMsg));
- if (value == null) throw new ArgumentNullException(nameof(value));
-
- var twCap = new TW_CAPABILITY
- {
- Cap = Cap,
- ConType = TWON.RANGE
- };
- try
- {
- ValueWriter.WriteRangeContainer(_twain, ref twCap, value);
- return _twain.DatCapability(DG.CONTROL, setMsg, ref twCap);
- }
- finally
- {
- if (twCap.hContainer != IntPtr.Zero)
- _twain.DsmMemFree(ref twCap.hContainer);
- }
- }
-
- ///
- /// Try to set an array value for the cap.
- ///
- ///
- ///
- ///
- public STS SetOrConstraint(MSG setMsg, Enumeration value)
- {
- if (setMsg != MSG.SET && setMsg != MSG.SETCONSTRAINT)
- throw new ArgumentException($"Only {nameof(MSG.SET)} and {nameof(MSG.SETCONSTRAINT)} messages are supported.", nameof(setMsg));
- if (value == null) throw new ArgumentNullException(nameof(value));
-
- var twCap = new TW_CAPABILITY
- {
- Cap = Cap,
- ConType = TWON.ENUMERATION
- };
- try
- {
- ValueWriter.WriteEnumContainer(_twain, ref twCap, value);
- return _twain.DatCapability(DG.CONTROL, setMsg, ref twCap);
- }
- finally
- {
- if (twCap.hContainer != IntPtr.Zero)
- _twain.DsmMemFree(ref twCap.hContainer);
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/NTwain-temp/Capabilities.cs b/src/NTwain-temp/Capabilities.cs
deleted file mode 100644
index 6c26635..0000000
--- a/src/NTwain-temp/Capabilities.cs
+++ /dev/null
@@ -1,1696 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using TWAINWorkingGroup;
-using static TWAINWorkingGroup.TWAIN;
-
-namespace NTwain
-{
- ///
- /// Contains known capabilities for TWAIN 2.4. If a device has own cap or
- /// uses different type for the cap then create your own
- /// for working with them.
- ///
- public class Capabilities
- {
- private readonly TWAIN _twain;
-
- public Capabilities(TWAIN twain)
- {
- _twain = twain;
- }
-
-
- ///
- /// Resets all cap values and constraint to power-on defaults.
- /// Not all sources will support this.
- ///
- ///
- public STS ResetAll()
- {
- var twCap = new TW_CAPABILITY
- {
- Cap = CAP.CAP_SUPPORTEDCAPS
- };
-
- var sts = _twain.DatCapability(DG.CONTROL, MSG.RESETALL, ref twCap);
- return sts;
- }
-
-
- #region audio caps
-
- private CapWrapper _audXferMech;
- public CapWrapper ACAP_XFERMECH
- {
- get
- {
- return _audXferMech ?? (_audXferMech = new CapWrapper(_twain, CAP.ACAP_XFERMECH));
- }
- }
-
- #endregion
-
- #region img caps
-
- #region mandatory
-
- private CapWrapper _compression;
- public CapWrapper ICAP_COMPRESSION
- {
- get
- {
- return _compression ?? (_compression = new CapWrapper(_twain, CAP.ICAP_COMPRESSION));
- }
- }
-
-
- private CapWrapper _pixelType;
- public CapWrapper ICAP_PIXELTYPE
- {
- get
- {
- return _pixelType ?? (_pixelType = new CapWrapper(_twain, CAP.ICAP_PIXELTYPE));
- }
- }
-
- private CapWrapper _imgUnits;
- public CapWrapper ICAP_UNITS
- {
- get
- {
- return _imgUnits ?? (_imgUnits = new CapWrapper(_twain, CAP.ICAP_UNITS));
- }
- }
-
- private CapWrapper _imgXferMech;
- public CapWrapper ICAP_XFERMECH
- {
- get
- {
- return _imgXferMech ?? (_imgXferMech = new CapWrapper(_twain, CAP.ICAP_XFERMECH));
- }
- }
-
- #endregion
-
- private CapWrapper _autoBright;
- public CapWrapper ICAP_AUTOBRIGHT
- {
- get
- {
- return _autoBright ?? (_autoBright = new CapWrapper(_twain, CAP.ICAP_AUTOBRIGHT));
- }
- }
-
- private CapWrapper _brightness;
- public CapWrapper ICAP_BRIGHTNESS
- {
- get
- {
- return _brightness ?? (_brightness = new CapWrapper(_twain, CAP.ICAP_BRIGHTNESS));
- }
- }
-
- private CapWrapper _contrast;
- public CapWrapper ICAP_CONTRAST
- {
- get
- {
- return _contrast ?? (_contrast = new CapWrapper(_twain, CAP.ICAP_CONTRAST));
- }
- }
-
- private CapWrapper _custHalftone;
- public CapWrapper ICAP_CUSTHALFTONE
- {
- get
- {
- return _custHalftone ?? (_custHalftone = new CapWrapper(_twain, CAP.ICAP_CUSTHALFTONE));
- }
- }
-
- private CapWrapper _exposureTime;
- ///
- /// Gets the property to work with image exposure time (in seconds) for the current source.
- ///
- ///
- /// The image exposure time.
- ///
- public CapWrapper ICAP_EXPOSURETIME
- {
- get
- {
- return _exposureTime ?? (_exposureTime = new CapWrapper(_twain, CAP.ICAP_EXPOSURETIME));
- }
- }
-
- private CapWrapper _filter;
- public CapWrapper ICAP_FILTER
- {
- get
- {
- return _filter ?? (_filter = new CapWrapper(_twain, CAP.ICAP_FILTER));
- }
- }
-
- private CapWrapper _gamma;
- public CapWrapper ICAP_GAMMA
- {
- get
- {
- return _gamma ?? (_gamma = new CapWrapper(_twain, CAP.ICAP_GAMMA));
- }
- }
-
- private CapWrapper _halftones;
- public CapWrapper ICAP_HALFTONES
- {
- get
- {
- return _halftones ?? (_halftones = new CapWrapper(_twain, CAP.ICAP_HALFTONES));
- }
- }
-
- private CapWrapper _highlight;
- public CapWrapper ICAP_HIGHLIGHT
- {
- get
- {
- return _highlight ?? (_highlight = new CapWrapper(_twain, CAP.ICAP_HIGHLIGHT));
- }
- }
-
- private CapWrapper _fileFormat;
- public CapWrapper ICAP_IMAGEFILEFORMAT
- {
- get
- {
- return _fileFormat ?? (_fileFormat = new CapWrapper(_twain, CAP.ICAP_IMAGEFILEFORMAT));
- }
- }
-
-
- private CapWrapper _lampState;
- public CapWrapper ICAP_LAMPSTATE
- {
- get
- {
- return _lampState ?? (_lampState = new CapWrapper(_twain, CAP.ICAP_LAMPSTATE));
- }
- }
-
- private CapWrapper _lightSource;
- public CapWrapper ICAP_LIGHTSOURCE
- {
- get
- {
- return _lightSource ?? (_lightSource = new CapWrapper(_twain, CAP.ICAP_LIGHTSOURCE));
- }
- }
-
- private CapWrapper _orientation;
- public CapWrapper ICAP_ORIENTATION
- {
- get
- {
- return _orientation ?? (_orientation = new CapWrapper(_twain, CAP.ICAP_ORIENTATION));
- }
- }
-
- private CapWrapper _physicalWidth;
- public CapWrapper ICAP_PHYSICALWIDTH
- {
- get
- {
- return _physicalWidth ?? (_physicalWidth = new CapWrapper(_twain, CAP.ICAP_PHYSICALWIDTH));
- }
- }
-
- private CapWrapper _physicalHeight;
- public CapWrapper ICAP_PHYSICALHEIGHT
- {
- get
- {
- return _physicalHeight ?? (_physicalHeight = new CapWrapper(_twain, CAP.ICAP_PHYSICALHEIGHT));
- }
- }
-
- private CapWrapper _shadow;
- public CapWrapper ICAP_SHADOW
- {
- get
- {
- return _shadow ?? (_shadow = new CapWrapper(_twain, CAP.ICAP_SHADOW));
- }
- }
-
- private CapWrapper _frames;
- public CapWrapper ICAP_FRAMES
- {
- get
- {
- return _frames ?? (_frames = new CapWrapper(_twain, CAP.ICAP_FRAMES));
- }
- }
-
- private CapWrapper _nativeXRes;
- public CapWrapper ICAP_XNATIVERESOLUTION
- {
- get
- {
- return _nativeXRes ?? (_nativeXRes = new CapWrapper(_twain, CAP.ICAP_XNATIVERESOLUTION));
- }
- }
-
- private CapWrapper _nativeYRes;
- public CapWrapper ICAP_YNATIVERESOLUTION
- {
- get
- {
- return _nativeYRes ?? (_nativeYRes = new CapWrapper(_twain, CAP.ICAP_YNATIVERESOLUTION));
- }
- }
-
- private CapWrapper _xResolution;
- public CapWrapper ICAP_XRESOLUTION
- {
- get
- {
- return _xResolution ?? (_xResolution = new CapWrapper(_twain, CAP.ICAP_XRESOLUTION));
- }
- }
-
-
- private CapWrapper _yResolution;
- public CapWrapper ICAP_YRESOLUTION
- {
- get
- {
- return _yResolution ?? (_yResolution = new CapWrapper(_twain, CAP.ICAP_YRESOLUTION));
- }
- }
-
- private CapWrapper _maxFrames;
- public CapWrapper ICAP_MAXFRAMES
- {
- get
- {
- return _maxFrames ?? (_maxFrames = new CapWrapper(_twain, CAP.ICAP_MAXFRAMES));
- }
- }
-
- private CapWrapper _tiles;
- public CapWrapper ICAP_TILES
- {
- get
- {
- return _tiles ?? (_tiles = new CapWrapper(_twain, CAP.ICAP_TILES));
- }
- }
-
- private CapWrapper _bitOrder;
- public CapWrapper ICAP_BITORDER
- {
- get
- {
- return _bitOrder ?? (_bitOrder = new CapWrapper(_twain, CAP.ICAP_BITORDER));
- }
- }
-
- private CapWrapper _ccittKFactor;
- public CapWrapper ICAP_CCITTKFACTOR
- {
- get
- {
- return _ccittKFactor ?? (_ccittKFactor = new CapWrapper(_twain, CAP.ICAP_CCITTKFACTOR));
- }
- }
-
- private CapWrapper _lightPath;
- public CapWrapper ICAP_LIGHTPATH
- {
- get
- {
- return _lightPath ?? (_lightPath = new CapWrapper(_twain, CAP.ICAP_LIGHTPATH));
- }
- }
-
- private CapWrapper _pixelFlavor;
- public CapWrapper ICAP_PIXELFLAVOR
- {
- get
- {
- return _pixelFlavor ?? (_pixelFlavor = new CapWrapper(_twain, CAP.ICAP_PIXELFLAVOR));
- }
- }
-
- private CapWrapper _planarChunky;
- public CapWrapper ICAP_PLANARCHUNKY
- {
- get
- {
- return _planarChunky ?? (_planarChunky = new CapWrapper(_twain, CAP.ICAP_PLANARCHUNKY));
- }
- }
-
- private CapWrapper _rotation;
- public CapWrapper ICAP_ROTATION
- {
- get
- {
- return _rotation ?? (_rotation = new CapWrapper(_twain, CAP.ICAP_ROTATION));
- }
- }
-
- private CapWrapper _supportSize;
- public CapWrapper ICAP_SUPPORTEDSIZES
- {
- get
- {
- return _supportSize ?? (_supportSize = new CapWrapper(_twain, CAP.ICAP_SUPPORTEDSIZES));
- }
- }
-
- private CapWrapper _threshold;
- public CapWrapper ICAP_THRESHOLD
- {
- get
- {
- return _threshold ?? (_threshold = new CapWrapper(_twain, CAP.ICAP_THRESHOLD));
- }
- }
-
- private CapWrapper _xscaling;
- public CapWrapper ICAP_XSCALING
- {
- get
- {
- return _xscaling ?? (_xscaling = new CapWrapper(_twain, CAP.ICAP_XSCALING));
- }
- }
-
- private CapWrapper _yscaling;
- public CapWrapper ICAP_YSCALING
- {
- get
- {
- return _yscaling ?? (_yscaling = new CapWrapper(_twain, CAP.ICAP_YSCALING));
- }
- }
-
- private CapWrapper _bitorderCodes;
-
- ///
- /// Gets the property to work with image CCITT compression for the current source.
- ///
- ///
- /// The image bit order for CCITT compression.
- ///
- public CapWrapper ICAP_BITORDERCODES
- {
- get
- {
- return _bitorderCodes ?? (_bitorderCodes = new CapWrapper(_twain, CAP.ICAP_BITORDERCODES));
- }
- }
-
- private CapWrapper _pixelFlavorCodes;
-
- ///
- /// Gets the property to work with image CCITT compression for the current source.
- ///
- ///
- /// The image pixel flavor for CCITT compression.
- ///
- public CapWrapper ICAP_PIXELFLAVORCODES
- {
- get
- {
- return _pixelFlavorCodes ?? (_pixelFlavorCodes = new CapWrapper(_twain, CAP.ICAP_PIXELFLAVORCODES));
- }
- }
-
- private CapWrapper _jpegPixelType;
-
- ///
- /// Gets the property to work with image jpeg compression for the current source.
- ///
- ///
- /// The image pixel type for jpeg compression.
- ///
- public CapWrapper ICAP_JPEGPIXELTYPE
- {
- get
- {
- return _jpegPixelType ?? (_jpegPixelType = new CapWrapper(_twain, CAP.ICAP_JPEGPIXELTYPE));
- }
- }
-
- private CapWrapper _timeFill;
-
- ///
- /// Gets the property to work with image CCITT time fill for the current source.
- ///
- ///
- /// The image CCITT time fill.
- ///
- public CapWrapper ICAP_TIMEFILL
- {
- get
- {
- return _timeFill ?? (_timeFill = new CapWrapper(_twain, CAP.ICAP_TIMEFILL));
- }
- }
-
- private CapWrapper _bitDepth;
- public CapWrapper ICAP_BITDEPTH
- {
- get
- {
- return _bitDepth ?? (_bitDepth = new CapWrapper(_twain, CAP.ICAP_BITDEPTH));
- }
- }
-
- private CapWrapper _bitDepthReduction;
- public CapWrapper ICAP_BITDEPTHREDUCTION
- {
- get
- {
- return _bitDepthReduction ?? (_bitDepthReduction = new CapWrapper(_twain, CAP.ICAP_BITDEPTHREDUCTION));
- }
- }
-
- private CapWrapper _undefinedImgSize;
- public CapWrapper ICAP_UNDEFINEDIMAGESIZE
- {
- get
- {
- return _undefinedImgSize ?? (_undefinedImgSize = new CapWrapper(_twain, CAP.ICAP_UNDEFINEDIMAGESIZE));
- }
- }
-
- private CapWrapper _imgDataSet;
-
- ///
- /// Gets or sets the image indices that will be delivered during the standard image transfer done in
- /// States 6 and 7.
- ///
- ///
- /// The image indicies.
- ///
- public CapWrapper ICAP_IMAGEDATASET
- {
- get
- {
- return _imgDataSet ?? (_imgDataSet = new CapWrapper(_twain, CAP.ICAP_IMAGEDATASET));
- }
- }
-
- private CapWrapper _extImgInfo;
- public CapWrapper ICAP_EXTIMAGEINFO
- {
- get
- {
- return _extImgInfo ?? (_extImgInfo = new CapWrapper(_twain, CAP.ICAP_EXTIMAGEINFO));
- }
- }
-
- private CapWrapper _minHeight;
- public CapWrapper ICAP_MINIMUMHEIGHT
- {
- get
- {
- return _minHeight ?? (_minHeight = new CapWrapper(_twain, CAP.ICAP_MINIMUMHEIGHT));
- }
- }
-
- private CapWrapper _minWidth;
- public CapWrapper ICAP_MINIMUMWIDTH
- {
- get
- {
- return _minWidth ?? (_minWidth = new CapWrapper(_twain, CAP.ICAP_MINIMUMWIDTH));
- }
- }
-
- private CapWrapper _autoDiscBlankPg;
- public CapWrapper ICAP_AUTODISCARDBLANKPAGES
- {
- get
- {
- return _autoDiscBlankPg ?? (_autoDiscBlankPg = new CapWrapper(_twain, CAP.ICAP_AUTODISCARDBLANKPAGES));
- }
- }
-
- private CapWrapper _flipRotation;
- public CapWrapper ICAP_FLIPROTATION
- {
- get
- {
- return _flipRotation ?? (_flipRotation = new CapWrapper(_twain, CAP.ICAP_FLIPROTATION));
- }
- }
-
- private CapWrapper _barcodeDetectEnabled;
- public CapWrapper ICAP_BARCODEDETECTIONENABLED
- {
- get
- {
- return _barcodeDetectEnabled ?? (_barcodeDetectEnabled = new CapWrapper(_twain, CAP.ICAP_BARCODEDETECTIONENABLED));
- }
- }
-
- private CapWrapper _barcodeType;
- public CapWrapper ICAP_SUPPORTEDBARCODETYPES
- {
- get
- {
- return _barcodeType ?? (_barcodeType = new CapWrapper(_twain, CAP.ICAP_SUPPORTEDBARCODETYPES));
- }
- }
-
- private CapWrapper _barcodeMaxPriority;
- public CapWrapper ICAP_BARCODEMAXSEARCHPRIORITIES
- {
- get
- {
- return _barcodeMaxPriority ?? (_barcodeMaxPriority = new CapWrapper(_twain, CAP.ICAP_BARCODEMAXSEARCHPRIORITIES));
- }
- }
-
- private CapWrapper _barcodeSearchPriority;
- public CapWrapper ICAP_BARCODESEARCHPRIORITIES
- {
- get
- {
- return _barcodeSearchPriority ?? (_barcodeSearchPriority = new CapWrapper(_twain, CAP.ICAP_BARCODESEARCHPRIORITIES));
- }
- }
-
- private CapWrapper _barcodeSearchMode;
- public CapWrapper ICAP_BARCODESEARCHMODE
- {
- get
- {
- return _barcodeSearchMode ?? (_barcodeSearchMode = new CapWrapper(_twain, CAP.ICAP_BARCODESEARCHMODE));
- }
- }
-
- private CapWrapper _barcodeMaxRetries;
- public CapWrapper ICAP_BARCODEMAXRETRIES
- {
- get
- {
- return _barcodeMaxRetries ?? (_barcodeMaxRetries = new CapWrapper(_twain, CAP.ICAP_BARCODEMAXRETRIES));
- }
- }
-
- private CapWrapper _barcodeTimeout;
-
- ///
- /// Gets the property to work with image barcode max search timeout for the current source.
- ///
- ///
- /// The image barcode max search timeout.
- ///
- public CapWrapper ICAP_BARCODETIMEOUT
- {
- get
- {
- return _barcodeTimeout ?? (_barcodeTimeout = new CapWrapper(_twain, CAP.ICAP_BARCODETIMEOUT));
- }
- }
-
- private CapWrapper _zoomFactor;
- public CapWrapper ICAP_ZOOMFACTOR
- {
- get
- {
- return _zoomFactor ?? (_zoomFactor = new CapWrapper(_twain, CAP.ICAP_ZOOMFACTOR));
- }
- }
-
- private CapWrapper _patchcodeDetectEnabled;
- public CapWrapper ICAP_PATCHCODEDETECTIONENABLED
- {
- get
- {
- return _patchcodeDetectEnabled ?? (_patchcodeDetectEnabled = new CapWrapper(_twain, CAP.ICAP_PATCHCODEDETECTIONENABLED));
- }
- }
-
- private CapWrapper _patchcodeType;
- public CapWrapper ICAP_SUPPORTEDPATCHCODETYPES
- {
- get
- {
- return _patchcodeType ?? (_patchcodeType = new CapWrapper(_twain, CAP.ICAP_SUPPORTEDPATCHCODETYPES));
- }
- }
-
- private CapWrapper _patchcodeMaxPriority;
- public CapWrapper ICAP_PATCHCODEMAXSEARCHPRIORITIES
- {
- get
- {
- return _patchcodeMaxPriority ?? (_patchcodeMaxPriority = new CapWrapper(_twain, CAP.ICAP_PATCHCODEMAXSEARCHPRIORITIES));
- }
- }
-
- private CapWrapper _patchcodeSearchPriority;
- public CapWrapper ICAP_PATCHCODESEARCHPRIORITIES
- {
- get
- {
- return _patchcodeSearchPriority ?? (_patchcodeSearchPriority = new CapWrapper(_twain, CAP.ICAP_PATCHCODESEARCHPRIORITIES));
- }
- }
-
- private CapWrapper _patchcodeSearchMode;
- public CapWrapper ICAP_PATCHCODESEARCHMODE
- {
- get
- {
- return _patchcodeSearchMode ?? (_patchcodeSearchMode = new CapWrapper(_twain, CAP.ICAP_PATCHCODESEARCHMODE));
- }
- }
-
- private CapWrapper _patchCodeMaxRetries;
- public CapWrapper ICAP_PATCHCODEMAXRETRIES
- {
- get
- {
- return _patchCodeMaxRetries ?? (_patchCodeMaxRetries = new CapWrapper(_twain, CAP.ICAP_PATCHCODEMAXRETRIES));
- }
- }
-
- private CapWrapper _patchCodeTimeout;
- public CapWrapper ICAP_PATCHCODETIMEOUT
- {
- get
- {
- return _patchCodeTimeout ?? (_patchCodeTimeout = new CapWrapper(_twain, CAP.ICAP_PATCHCODETIMEOUT));
- }
- }
-
- private CapWrapper _flashUsed2;
- public CapWrapper ICAP_FLASHUSED2
- {
- get
- {
- return _flashUsed2 ?? (_flashUsed2 = new CapWrapper(_twain, CAP.ICAP_FLASHUSED2));
- }
- }
-
- private CapWrapper _imgFilter;
- public CapWrapper ICAP_IMAGEFILTER
- {
- get
- {
- return _imgFilter ?? (_imgFilter = new CapWrapper(_twain, CAP.ICAP_IMAGEFILTER));
- }
- }
-
- private CapWrapper _noiseFilter;
- public CapWrapper ICAP_NOISEFILTER
- {
- get
- {
- return _noiseFilter ?? (_noiseFilter = new CapWrapper(_twain, CAP.ICAP_NOISEFILTER));
- }
- }
-
- private CapWrapper _overscan;
- public CapWrapper ICAP_OVERSCAN
- {
- get
- {
- return _overscan ?? (_overscan = new CapWrapper(_twain, CAP.ICAP_OVERSCAN));
- }
- }
-
- private CapWrapper _borderDetect;
- public CapWrapper ICAP_AUTOMATICBORDERDETECTION
- {
- get
- {
- return _borderDetect ?? (_borderDetect = new CapWrapper(_twain, CAP.ICAP_AUTOMATICBORDERDETECTION));
-
- // this needs to also set undefined size optino
- }
- }
-
- private CapWrapper _autoDeskew;
- public CapWrapper ICAP_AUTOMATICDESKEW
- {
- get
- {
- return _autoDeskew ?? (_autoDeskew = new CapWrapper(_twain, CAP.ICAP_AUTOMATICDESKEW));
- }
- }
-
- private CapWrapper _autoRotate;
- public CapWrapper ICAP_AUTOMATICROTATE
- {
- get
- {
- return _autoRotate ?? (_autoRotate = new CapWrapper(_twain, CAP.ICAP_AUTOMATICROTATE));
- }
- }
-
- private CapWrapper _jpegQuality;
- public CapWrapper ICAP_JPEGQUALITY
- {
- get
- {
- //TODO: verify
- return _jpegQuality ?? (_jpegQuality = new CapWrapper(_twain, CAP.ICAP_JPEGQUALITY));
- }
- }
-
- private CapWrapper _feederType;
- public CapWrapper ICAP_FEEDERTYPE
- {
- get
- {
- return _feederType ?? (_feederType = new CapWrapper(_twain, CAP.ICAP_FEEDERTYPE));
- }
- }
-
- private CapWrapper _iccProfile;
- public CapWrapper ICAP_ICCPROFILE
- {
- get
- {
- return _iccProfile ?? (_iccProfile = new CapWrapper(_twain, CAP.ICAP_ICCPROFILE));
- }
- }
-
- private CapWrapper _autoSize;
- public CapWrapper ICAP_AUTOSIZE
- {
- get
- {
- return _autoSize ?? (_autoSize = new CapWrapper(_twain, CAP.ICAP_AUTOSIZE));
- }
- }
-
- private CapWrapper _cropUseFrame;
- public CapWrapper ICAP_AUTOMATICCROPUSESFRAME
- {
- get
- {
- return _cropUseFrame ?? (_cropUseFrame = new CapWrapper