mirror of
https://github.com/soukoku/ntwain.git
synced 2025-09-19 01:57:56 +08:00
More ICaps
This commit is contained in:
@@ -354,6 +354,7 @@ namespace NTwain
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="value">The value.</param>
|
/// <param name="value">The value.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
/// <exception cref="System.InvalidOperationException">Simple Set() is not defined for this capability.</exception>
|
||||||
public ReturnCode Set(TValue value)
|
public ReturnCode Set(TValue value)
|
||||||
{
|
{
|
||||||
ReturnCode rc = ReturnCode.Failure;
|
ReturnCode rc = ReturnCode.Failure;
|
||||||
@@ -370,6 +371,28 @@ namespace NTwain
|
|||||||
rc = _source.DGControl.Capability.Set(cap);
|
rc = _source.DGControl.Capability.Set(cap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException("Simple Set() is not defined for this capability.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A version of Set that uses an array.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value">The value.</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public ReturnCode Set(TWArray value)
|
||||||
|
{
|
||||||
|
ReturnCode rc = ReturnCode.Failure;
|
||||||
|
if (CanSet)
|
||||||
|
{
|
||||||
|
using (var cap = new TWCapability(Capability, value))
|
||||||
|
{
|
||||||
|
rc = _source.DGControl.Capability.Set(cap);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@@ -654,7 +654,6 @@ namespace NTwain.Data
|
|||||||
public TWCapability(CapabilityId capability, TWOneValue value, IMemoryManager memoryManager)
|
public TWCapability(CapabilityId capability, TWOneValue value, IMemoryManager memoryManager)
|
||||||
{
|
{
|
||||||
Capability = capability;
|
Capability = capability;
|
||||||
ContainerType = ContainerType.OneValue;
|
|
||||||
SetOneValue(value, memoryManager);
|
SetOneValue(value, memoryManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -675,7 +674,6 @@ namespace NTwain.Data
|
|||||||
public TWCapability(CapabilityId capability, TWEnumeration value, IMemoryManager memoryManager)
|
public TWCapability(CapabilityId capability, TWEnumeration value, IMemoryManager memoryManager)
|
||||||
{
|
{
|
||||||
Capability = capability;
|
Capability = capability;
|
||||||
ContainerType = ContainerType.Enum;
|
|
||||||
SetEnumValue(value, memoryManager);
|
SetEnumValue(value, memoryManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -696,9 +694,28 @@ namespace NTwain.Data
|
|||||||
public TWCapability(CapabilityId capability, TWRange value, IMemoryManager memoryManager)
|
public TWCapability(CapabilityId capability, TWRange value, IMemoryManager memoryManager)
|
||||||
{
|
{
|
||||||
Capability = capability;
|
Capability = capability;
|
||||||
ContainerType = ContainerType.Range;
|
|
||||||
SetRangeValue(value, memoryManager);
|
SetRangeValue(value, memoryManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="TWCapability" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="capability">The capability.</param>
|
||||||
|
/// <param name="value">The value.</param>
|
||||||
|
public TWCapability(CapabilityId capability, TWArray value)
|
||||||
|
: this(capability, value, PlatformInfo.Current.MemoryManager) { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="TWCapability" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="capability">The capability.</param>
|
||||||
|
/// <param name="value">The value.</param>
|
||||||
|
/// <param name="memoryManager">The memory manager.</param>
|
||||||
|
public TWCapability(CapabilityId capability, TWArray value, IMemoryManager memoryManager)
|
||||||
|
{
|
||||||
|
Capability = capability;
|
||||||
|
SetArrayValue(value, memoryManager);
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region properties
|
#region properties
|
||||||
@@ -759,7 +776,6 @@ namespace NTwain.Data
|
|||||||
memoryManager.Unlock(baseAddr);
|
memoryManager.Unlock(baseAddr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SetRangeValue(TWRange value, IMemoryManager memoryManager)
|
void SetRangeValue(TWRange value, IMemoryManager memoryManager)
|
||||||
{
|
{
|
||||||
if (value == null) { throw new ArgumentNullException("value"); }
|
if (value == null) { throw new ArgumentNullException("value"); }
|
||||||
@@ -774,6 +790,28 @@ namespace NTwain.Data
|
|||||||
Marshal.StructureToPtr(value, _hContainer, false);
|
Marshal.StructureToPtr(value, _hContainer, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetArrayValue(TWArray value, IMemoryManager memoryManager)
|
||||||
|
{
|
||||||
|
if (value == null) { throw new ArgumentNullException("value"); }
|
||||||
|
ContainerType = ContainerType.Array;
|
||||||
|
|
||||||
|
Int32 valueSize = 6 + value.ItemList.Length * TypeReader.GetItemTypeSize(value.ItemType);
|
||||||
|
|
||||||
|
int offset = 0;
|
||||||
|
_hContainer = memoryManager.Allocate((uint)valueSize);
|
||||||
|
IntPtr baseAddr = memoryManager.Lock(_hContainer);
|
||||||
|
|
||||||
|
// can't safely use StructureToPtr here so write it our own
|
||||||
|
WriteValue(baseAddr, ref offset, ItemType.UInt16, value.ItemType);
|
||||||
|
WriteValue(baseAddr, ref offset, ItemType.UInt32, (uint)value.ItemList.Length);
|
||||||
|
foreach (var item in value.ItemList)
|
||||||
|
{
|
||||||
|
WriteValue(baseAddr, ref offset, value.ItemType, item);
|
||||||
|
}
|
||||||
|
memoryManager.Unlock(baseAddr);
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region writes
|
#region writes
|
||||||
|
@@ -225,7 +225,7 @@ namespace NTwain.Data
|
|||||||
/// Corresponds to TWBP_* values.
|
/// Corresponds to TWBP_* values.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||||
public enum BlankPage : short
|
public enum BlankPage //: short
|
||||||
{
|
{
|
||||||
Invalid = 0,
|
Invalid = 0,
|
||||||
Disable = -2,
|
Disable = -2,
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,6 @@
|
|||||||
using NTwain.Data;
|
using NTwain.Data;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
namespace NTwain
|
namespace NTwain
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -57,19 +58,44 @@ namespace NTwain
|
|||||||
/// </value>
|
/// </value>
|
||||||
bool CanGetLabelEnum { get; }
|
bool CanGetLabelEnum { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a value indicating whether <see cref="Reset"/> is supported.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// <c>true</c> if this capability can reset; otherwise, <c>false</c>.
|
||||||
|
/// </value>
|
||||||
|
bool CanReset { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a value indicating whether <see cref="Set"/> is supported.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// <c>true</c> if this capability can set; otherwise, <c>false</c>.
|
||||||
|
/// </value>
|
||||||
|
bool CanSet { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a value indicating whether <see cref="SetConstraint"/> is supported.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// <c>true</c> if this capability can set constraint; otherwise, <c>false</c>.
|
||||||
|
/// </value>
|
||||||
|
bool CanSetConstraint { get; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the capability.
|
/// Gets the capability.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>
|
/// <value>
|
||||||
/// The capability.
|
/// The capability.
|
||||||
/// </value>
|
/// </value>
|
||||||
NTwain.Data.CapabilityId Capability { get; }
|
CapabilityId Capability { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets all the possible values of this capability.
|
/// Gets all the possible values of this capability.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
System.Collections.Generic.IList<TValue> Get();
|
IList<TValue> Get();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the current value of this capability.
|
/// Gets the current value of this capability.
|
||||||
@@ -99,7 +125,7 @@ namespace NTwain
|
|||||||
/// [Experimental] Gets the display names for possible values of this capability.
|
/// [Experimental] Gets the display names for possible values of this capability.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
System.Collections.Generic.IList<string> GetLabelEnum();
|
IList<string> GetLabelEnum();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether this capability is supported.
|
/// Gets a value indicating whether this capability is supported.
|
||||||
@@ -115,7 +141,7 @@ namespace NTwain
|
|||||||
/// <value>
|
/// <value>
|
||||||
/// The supported actions.
|
/// The supported actions.
|
||||||
/// </value>
|
/// </value>
|
||||||
NTwain.Data.QuerySupports SupportedActions { get; }
|
QuerySupports SupportedActions { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -124,42 +150,24 @@ namespace NTwain
|
|||||||
/// <typeparam name="TValue">The TWAIN type of the value.</typeparam>
|
/// <typeparam name="TValue">The TWAIN type of the value.</typeparam>
|
||||||
public interface ICapWrapper<TValue> : IReadOnlyCapWrapper<TValue>
|
public interface ICapWrapper<TValue> : IReadOnlyCapWrapper<TValue>
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Gets a value indicating whether <see cref="Reset"/> is supported.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>
|
|
||||||
/// <c>true</c> if this capability can reset; otherwise, <c>false</c>.
|
|
||||||
/// </value>
|
|
||||||
bool CanReset { get; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets a value indicating whether <see cref="Set"/> is supported.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>
|
|
||||||
/// <c>true</c> if this capability can set; otherwise, <c>false</c>.
|
|
||||||
/// </value>
|
|
||||||
bool CanSet { get; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets a value indicating whether <see cref="SetConstraint"/> is supported.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>
|
|
||||||
/// <c>true</c> if this capability can set constraint; otherwise, <c>false</c>.
|
|
||||||
/// </value>
|
|
||||||
bool CanSetConstraint { get; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Resets the current value to power-on default.
|
/// Resets the current value to power-on default.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
NTwain.Data.ReturnCode Reset();
|
ReturnCode Reset();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Simplified version that sets the current value of this capability.
|
/// Simplified version that sets the current value of this capability.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="value">The value.</param>
|
/// <param name="value">The value.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
NTwain.Data.ReturnCode Set(TValue value);
|
ReturnCode Set(TValue value);/// <summary>
|
||||||
|
///
|
||||||
|
/// A version of Set that uses an array.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value">The value.</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
ReturnCode Set(TWArray value);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the constraint value of this capability.
|
/// Sets the constraint value of this capability.
|
||||||
|
@@ -23,7 +23,7 @@ namespace NTwain
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The build release version number.
|
/// The build release version number.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string Build = "3.1.1"; // change this for each nuget release
|
public const string Build = "3.2.0"; // change this for each nuget release
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -126,7 +126,7 @@ namespace Tester.WPF
|
|||||||
switch (cap)
|
switch (cap)
|
||||||
{
|
{
|
||||||
case CapabilityId.ACapXferMech:
|
case CapabilityId.ACapXferMech:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapAudioXferMech.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ACapXferMech.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.CapAlarms:
|
case CapabilityId.CapAlarms:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapAlarmVolume.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapAlarmVolume.Get();
|
||||||
@@ -357,13 +357,13 @@ namespace Tester.WPF
|
|||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapAutoBright:
|
case CapabilityId.ICapAutoBright:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImageAutoBright.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapAutoBright.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapAutoDiscardBlankPages:
|
case CapabilityId.ICapAutoDiscardBlankPages:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapAutoDiscardBlankPages.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapAutomaticBorderDetection:
|
case CapabilityId.ICapAutomaticBorderDetection:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImageAutomaticBorderDetection.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapAutomaticBorderDetection.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapAutomaticColorEnabled:
|
case CapabilityId.ICapAutomaticColorEnabled:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
||||||
@@ -375,70 +375,70 @@ namespace Tester.WPF
|
|||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapAutomaticDeskew:
|
case CapabilityId.ICapAutomaticDeskew:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImageAutoDeskew.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapAutomaticDeskew.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapAutomaticLengthDetection:
|
case CapabilityId.ICapAutomaticLengthDetection:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapAutomaticRotate:
|
case CapabilityId.ICapAutomaticRotate:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImageAutoRotate.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapAutomaticRotate.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapAutoSize:
|
case CapabilityId.ICapAutoSize:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapAutoSize.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapBarcodeDetectionEnabled:
|
case CapabilityId.ICapBarcodeDetectionEnabled:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapBarcodeDetectionEnabled.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapBarcodeMaxRetries:
|
case CapabilityId.ICapBarcodeMaxRetries:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapBarcodeMaxRetries.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapBarcodeMaxSearchPriorities:
|
case CapabilityId.ICapBarcodeMaxSearchPriorities:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapBarcodeSearchPriorities.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapBarcodeSearchMode:
|
case CapabilityId.ICapBarcodeSearchMode:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapBarcodeSearchMode.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapBarcodeSearchPriorities:
|
case CapabilityId.ICapBarcodeSearchPriorities:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapBarcodeSearchPriorities.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapBarcodeTimeout:
|
case CapabilityId.ICapBarcodeTimeout:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapBarcodeTimeout.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapBitDepth:
|
case CapabilityId.ICapBitDepth:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapBitDepth.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapBitDepthReduction:
|
case CapabilityId.ICapBitDepthReduction:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap).CastToEnum<BitDepthReduction>();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapBitDepthReduction.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapBitOrder:
|
case CapabilityId.ICapBitOrder:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImageBitOrder.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapBitOrder.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapBitOrderCodes:
|
case CapabilityId.ICapBitOrderCodes:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapBitOrderCodes.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapBrightness:
|
case CapabilityId.ICapBrightness:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImageBrightness.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapBrightness.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapCCITTKFactor:
|
case CapabilityId.ICapCCITTKFactor:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImageCCITTKFactor.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapCCITTKFactor.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapColorManagementEnabled:
|
case CapabilityId.ICapColorManagementEnabled:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapCompression:
|
case CapabilityId.ICapCompression:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImageCompression.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapCompression.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapContrast:
|
case CapabilityId.ICapContrast:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImageContrast.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapContrast.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapCustHalftone:
|
case CapabilityId.ICapCustHalftone:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapExposureTime:
|
case CapabilityId.ICapExposureTime:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImageExposureTime.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapExposureTime.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapExtImageInfo:
|
case CapabilityId.ICapExtImageInfo:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapExtImageInfo.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapFeederType:
|
case CapabilityId.ICapFeederType:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap).CastToEnum<FeederType>();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap).CastToEnum<FeederType>();
|
||||||
@@ -447,40 +447,40 @@ namespace Tester.WPF
|
|||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap).CastToEnum<FilmType>();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap).CastToEnum<FilmType>();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapFilter:
|
case CapabilityId.ICapFilter:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap).CastToEnum<FilterType>();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapFilter.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapFlashUsed:
|
case CapabilityId.ICapFlashUsed:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapFlashUsed2:
|
case CapabilityId.ICapFlashUsed2:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap).CastToEnum<FlashedUsed>();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapFlashUsed2.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapFlipRotation:
|
case CapabilityId.ICapFlipRotation:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap).CastToEnum<FlipRotation>();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapFlipRotation.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapFrames:
|
case CapabilityId.ICapFrames:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapGamma:
|
case CapabilityId.ICapGamma:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImageGamma.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapGamma.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapHalftones:
|
case CapabilityId.ICapHalftones:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapHighlight:
|
case CapabilityId.ICapHighlight:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImageHighlight.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapHighlight.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapICCProfile:
|
case CapabilityId.ICapICCProfile:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap).CastToEnum<IccProfile>();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapICCProfile.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapImageDataSet:
|
case CapabilityId.ICapImageDataSet:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapImageFileFormat:
|
case CapabilityId.ICapImageFileFormat:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImageFileFormat.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapImageFileFormat.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapImageFilter:
|
case CapabilityId.ICapImageFilter:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImageFilter.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapImageMerge:
|
case CapabilityId.ICapImageMerge:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap).CastToEnum<ImageMerge>();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap).CastToEnum<ImageMerge>();
|
||||||
@@ -489,137 +489,137 @@ namespace Tester.WPF
|
|||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapJpegPixelType:
|
case CapabilityId.ICapJpegPixelType:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap).CastToEnum<PixelType>();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapJpegPixelType.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapJpegQuality:
|
case CapabilityId.ICapJpegQuality:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap).CastToEnum<JpegQuality>();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapJpegQuality.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapJpegSubsampling:
|
case CapabilityId.ICapJpegSubsampling:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap).CastToEnum<JpegSubsampling>();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap).CastToEnum<JpegSubsampling>();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapLampState:
|
case CapabilityId.ICapLampState:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImageLameState.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapLampState.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapLightPath:
|
case CapabilityId.ICapLightPath:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImageLightPath.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapLightPath.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapLightSource:
|
case CapabilityId.ICapLightSource:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImageLightSource.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapLightSource.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapMaxFrames:
|
case CapabilityId.ICapMaxFrames:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImageMaxFrames.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapMaxFrames.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapMinimumHeight:
|
case CapabilityId.ICapMinimumHeight:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapMinimumHeight.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapMinimumWidth:
|
case CapabilityId.ICapMinimumWidth:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapMinimumWidth.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapMirror:
|
case CapabilityId.ICapMirror:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap).CastToEnum<Mirror>();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap).CastToEnum<Mirror>();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapNoiseFilter:
|
case CapabilityId.ICapNoiseFilter:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap).CastToEnum<NoiseFilter>();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapNoiseFilter.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapOrientation:
|
case CapabilityId.ICapOrientation:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImageOrientation.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapOrientation.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapOverScan:
|
case CapabilityId.ICapOverScan:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap).CastToEnum<OverScan>();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapOverScan.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapPatchCodeDetectionEnabled:
|
case CapabilityId.ICapPatchCodeDetectionEnabled:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapPatchCodeDetectionEnabled.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapPatchCodeMaxRetries:
|
case CapabilityId.ICapPatchCodeMaxRetries:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapPatchCodeMaxRetries.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapPatchCodeMaxSearchPriorities:
|
case CapabilityId.ICapPatchCodeMaxSearchPriorities:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap).CastToEnum<PatchCode>();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapPatchCodeMaxSearchPriorities.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapPatchCodeSearchMode:
|
case CapabilityId.ICapPatchCodeSearchMode:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapPatchCodeSearchMode.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapPatchCodeSearchPriorities:
|
case CapabilityId.ICapPatchCodeSearchPriorities:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapPatchCodeSearchPriorities.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapPatchCodeTimeout:
|
case CapabilityId.ICapPatchCodeTimeout:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapPatchCodeTimeout.Get();
|
||||||
break;
|
break;
|
||||||
// TODO phys size are twfix32
|
// TODO phys size are twfix32
|
||||||
case CapabilityId.ICapPhysicalHeight:
|
case CapabilityId.ICapPhysicalHeight:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImagePhysicalHeight.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapPhysicalHeight.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapPhysicalWidth:
|
case CapabilityId.ICapPhysicalWidth:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImagePhysicalWidth.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapPhysicalWidth.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapPixelFlavor:
|
case CapabilityId.ICapPixelFlavor:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImagePixelFlavor.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapPixelFlavor.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapPixelFlavorCodes:
|
case CapabilityId.ICapPixelFlavorCodes:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapPixelFlavorCodes.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapPixelType:
|
case CapabilityId.ICapPixelType:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImagePixelType.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapPixelType.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapPlanarChunky:
|
case CapabilityId.ICapPlanarChunky:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImagePlanarChunky.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapPlanarChunky.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapRotation:
|
case CapabilityId.ICapRotation:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImageRotation.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapRotation.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapShadow:
|
case CapabilityId.ICapShadow:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImageShadow.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapShadow.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapSupportedBarcodeTypes:
|
case CapabilityId.ICapSupportedBarcodeTypes:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap).CastToEnum<BarcodeType>();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapSupportedBarcodeTypes.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapSupportedExtImageInfo:
|
case CapabilityId.ICapSupportedExtImageInfo:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap).CastToEnum<ExtendedImageInfo>();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap).CastToEnum<ExtendedImageInfo>();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapSupportedPatchCodeTypes:
|
case CapabilityId.ICapSupportedPatchCodeTypes:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap).CastToEnum<PatchCode>();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapSupportedPatchCodeTypes.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapSupportedSizes:
|
case CapabilityId.ICapSupportedSizes:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImageSupportedSize.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapSupportedSizes.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapThreshold:
|
case CapabilityId.ICapThreshold:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapThreshold.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapTiles:
|
case CapabilityId.ICapTiles:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImageTiles.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapTiles.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapTimeFill:
|
case CapabilityId.ICapTimeFill:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapTimeFill.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapUndefinedImageSize:
|
case CapabilityId.ICapUndefinedImageSize:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapUndefinedImageSize.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapUnits:
|
case CapabilityId.ICapUnits:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImageUnits.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapUnits.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapXferMech:
|
case CapabilityId.ICapXferMech:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImageXferMech.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapXferMech.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapXNativeResolution:
|
case CapabilityId.ICapXNativeResolution:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImageXNativeResolution.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapXNativeResolution.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapXResolution:
|
case CapabilityId.ICapXResolution:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImageXResolution.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapXResolution.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapXScaling:
|
case CapabilityId.ICapXScaling:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapXScaling.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapYNativeResolution:
|
case CapabilityId.ICapYNativeResolution:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImageYNativeResolution.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapYNativeResolution.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapYResolution:
|
case CapabilityId.ICapYResolution:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapImageYResolution.Get();
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapYResolution.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapYScaling:
|
case CapabilityId.ICapYScaling:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapYScaling.Get();
|
||||||
break;
|
break;
|
||||||
case CapabilityId.ICapZoomFactor:
|
case CapabilityId.ICapZoomFactor:
|
||||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
CapDetailList.ItemsSource = _twainVM.CurrentSource.ICapZoomFactor.Get();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (cap > CapabilityId.CustomBase)
|
if (cap > CapabilityId.CustomBase)
|
||||||
|
@@ -72,7 +72,7 @@ namespace Tester.WPF
|
|||||||
|
|
||||||
if (this.CurrentSource.CapGetCurrent(CapabilityId.ICapXferMech).ConvertToEnum<XferMech>() == XferMech.File)
|
if (this.CurrentSource.CapGetCurrent(CapabilityId.ICapXferMech).ConvertToEnum<XferMech>() == XferMech.File)
|
||||||
{
|
{
|
||||||
var formats = this.CurrentSource.CapImageFileFormat.Get();
|
var formats = this.CurrentSource.ICapImageFileFormat.Get();
|
||||||
var wantFormat = formats.Contains(FileFormat.Tiff) ? FileFormat.Tiff : FileFormat.Bmp;
|
var wantFormat = formats.Contains(FileFormat.Tiff) ? FileFormat.Tiff : FileFormat.Bmp;
|
||||||
|
|
||||||
var fileSetup = new TWSetupFileXfer
|
var fileSetup = new TWSetupFileXfer
|
||||||
@@ -123,14 +123,14 @@ namespace Tester.WPF
|
|||||||
{
|
{
|
||||||
if (State == 4)
|
if (State == 4)
|
||||||
{
|
{
|
||||||
if (this.CurrentSource.CapImagePixelType.Get().Contains(PixelType.BlackWhite))
|
if (this.CurrentSource.ICapPixelType.Get().Contains(PixelType.BlackWhite))
|
||||||
{
|
{
|
||||||
this.CurrentSource.CapImagePixelType.Set(PixelType.BlackWhite);
|
this.CurrentSource.ICapPixelType.Set(PixelType.BlackWhite);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.CurrentSource.CapImageXferMech.Get().Contains(XferMech.File))
|
if (this.CurrentSource.ICapXferMech.Get().Contains(XferMech.File))
|
||||||
{
|
{
|
||||||
this.CurrentSource.CapImageXferMech.Set(XferMech.File);
|
this.CurrentSource.ICapXferMech.Set(XferMech.File);
|
||||||
}
|
}
|
||||||
|
|
||||||
var rc = this.CurrentSource.Enable(SourceEnableMode.NoUI, false, hwnd);
|
var rc = this.CurrentSource.Enable(SourceEnableMode.NoUI, false, hwnd);
|
||||||
|
@@ -286,22 +286,22 @@ namespace Tester.Winform
|
|||||||
var src = _twain.CurrentSource;
|
var src = _twain.CurrentSource;
|
||||||
var caps = src.SupportedCaps;
|
var caps = src.SupportedCaps;
|
||||||
_loadingCaps = true;
|
_loadingCaps = true;
|
||||||
if (groupDepth.Enabled = src.CapImagePixelType.IsSupported)
|
if (groupDepth.Enabled = src.ICapPixelType.IsSupported)
|
||||||
{
|
{
|
||||||
LoadDepth(src.CapImagePixelType);
|
LoadDepth(src.ICapPixelType);
|
||||||
}
|
}
|
||||||
if (groupDPI.Enabled = src.CapImageXResolution.IsSupported && src.CapImageYResolution.IsSupported)
|
if (groupDPI.Enabled = src.ICapXResolution.IsSupported && src.ICapYResolution.IsSupported)
|
||||||
{
|
{
|
||||||
LoadDPI(src.CapImageXResolution);
|
LoadDPI(src.ICapXResolution);
|
||||||
}
|
}
|
||||||
// TODO: find out if this is how duplex works or also needs the other option
|
// TODO: find out if this is how duplex works or also needs the other option
|
||||||
if (groupDuplex.Enabled = src.CapDuplexEnabled.IsSupported)
|
if (groupDuplex.Enabled = src.CapDuplexEnabled.IsSupported)
|
||||||
{
|
{
|
||||||
LoadDuplex(src.CapDuplexEnabled);
|
LoadDuplex(src.CapDuplexEnabled);
|
||||||
}
|
}
|
||||||
if (groupSize.Enabled = src.CapImageSupportedSize.IsSupported)
|
if (groupSize.Enabled = src.ICapSupportedSizes.IsSupported)
|
||||||
{
|
{
|
||||||
LoadPaperSize(src.CapImageSupportedSize);
|
LoadPaperSize(src.ICapSupportedSizes);
|
||||||
}
|
}
|
||||||
btnAllSettings.Enabled = caps.Contains(CapabilityId.CapEnableDSUIOnly);
|
btnAllSettings.Enabled = caps.Contains(CapabilityId.CapEnableDSUIOnly);
|
||||||
_loadingCaps = false;
|
_loadingCaps = false;
|
||||||
@@ -363,7 +363,7 @@ namespace Tester.Winform
|
|||||||
if (!_loadingCaps && _twain.State == 4)
|
if (!_loadingCaps && _twain.State == 4)
|
||||||
{
|
{
|
||||||
var sel = (SupportedSize)comboSize.SelectedItem;
|
var sel = (SupportedSize)comboSize.SelectedItem;
|
||||||
_twain.CurrentSource.CapImageSupportedSize.Set(sel);
|
_twain.CurrentSource.ICapSupportedSizes.Set(sel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -372,7 +372,7 @@ namespace Tester.Winform
|
|||||||
if (!_loadingCaps && _twain.State == 4)
|
if (!_loadingCaps && _twain.State == 4)
|
||||||
{
|
{
|
||||||
var sel = (PixelType)comboDepth.SelectedItem;
|
var sel = (PixelType)comboDepth.SelectedItem;
|
||||||
_twain.CurrentSource.CapImagePixelType.Set(sel);
|
_twain.CurrentSource.ICapPixelType.Set(sel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -381,8 +381,8 @@ namespace Tester.Winform
|
|||||||
if (!_loadingCaps && _twain.State == 4)
|
if (!_loadingCaps && _twain.State == 4)
|
||||||
{
|
{
|
||||||
var sel = (TWFix32)comboDPI.SelectedItem;
|
var sel = (TWFix32)comboDPI.SelectedItem;
|
||||||
_twain.CurrentSource.CapImageXResolution.Set(sel);
|
_twain.CurrentSource.ICapXResolution.Set(sel);
|
||||||
_twain.CurrentSource.CapImageYResolution.Set(sel);
|
_twain.CurrentSource.ICapYResolution.Set(sel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user