Stop acquiring images only from the feeder of the TWAIN source.
Syntax
Visual Basic (Declaration) | |
---|
Public Sub StopFeeder() |
Visual Basic (Usage) | Copy Code |
---|
Dim instance As TwainSession
instance.StopFeeder()
|
C# | |
---|
public void StopFeeder() |
Managed Extensions for C++ | |
---|
public: void StopFeeder(); |
C++/CLI | |
---|
public:
void StopFeeder(); |
Example
Visual Basic | Copy Code |
---|
Dim acq_session As TwainSession
Private Sub twain_AcquirePage(ByVal sender As Object, ByVal e As TwainAcquirePageEventArgs)
acq_session.StopFeeder()
End Sub
Public Sub AcquireExample(ByVal parent As IWin32Window)
acq_session = New TwainSession()
acq_session.Startup(parent, "LEAD Technologies, Inc.", "LEAD Twain .NET", "Version 14", "LEADTools Twain test sample", TwainStartupFlags.None)
acq_session.SelectSource(String.Empty)
Dim props As TwainProperties = acq_session.Properties
Dim dataProps As TwainDataTransferProperties = props.DataTransfer
dataProps.FileName = "C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\twain.bmp"
dataProps.MemoryBufferSize = dataProps.MemoryBufferSize * 2
props.DataTransfer = dataProps
acq_session.Properties = props
Dim opts As TwainTransferOptions = acq_session.TransferOptions
AddHandler acq_session.AcquirePage, AddressOf twain_AcquirePage
If acq_session.Acquire(TwainUserInterfaceFlags.Show) <> DialogResult.OK Then
MessageBox.Show("Error Acquiring From Source")
End If
acq_session.Shutdown()
End Sub |
C# | Copy Code |
---|
TwainSession acq_session; private void twain_AcquirePage(object sender, TwainAcquirePageEventArgs e) { // get acquired image here // call StopFeeder method here if you need to stop the feeder acq_session.StopFeeder(); } public void AcquireExample(IWin32Window parent) { acq_session = new TwainSession(); acq_session.Startup(parent, "LEAD Technologies, Inc.", "LEAD Twain .NET", "Version 14", "LEADTools Twain test sample", TwainStartupFlags.None); acq_session.SelectSource(String.Empty); TwainProperties props = acq_session.Properties; TwainDataTransferProperties dataProps = props.DataTransfer; dataProps.FileName = @"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\twain.bmp"; dataProps.MemoryBufferSize = dataProps.MemoryBufferSize * 2; props.DataTransfer = dataProps; acq_session.Properties = props; TwainTransferOptions opts = acq_session.TransferOptions; acq_session.AcquirePage += new EventHandler<TwainAcquirePageEventArgs>(twain_AcquirePage); if (acq_session.Acquire(TwainUserInterfaceFlags.Show) != DialogResult.OK) MessageBox.Show("Error Acquiring From Source"); acq_session.Shutdown(); } |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also