Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Thursday, January 14, 2010 11:15:43 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 769


Attached is a simple C# 2005 project that uses LEADTOOLS .NET 16.5 to show how to do Twain scanning in a background thread.  As pages are scanned it will populate a RasterImageList and let you select and view images while additional pages are being scanned.

One should note that there can be some limitations based on the scanner driver.  Most scanners' dialogs are modeless, meaning you can still use your application even though the scanner's dialog is active and on the screen.  However, most scanner manufacturers make their dialogs the top most window (just like Task Manager) so even though you can click and move your application's window around, the scanner's dialog will still be drawn over it.  This is true for Fujitsu, Panasonic, Canon, and the sample Twain Source.  AFAIK, the only manufacturer who doesn't make their dialog the top most window is Kodak.  With Kodak's dialog present you can click on your application and your application will be painted over Kodak's dialog.

According to the Twain specifications, CAP_INDICATORS will enable/disable the progress dialog.  You can only suppress the progress indicator when you choose NOT to display the UI.  Therefore the only way to truly use Twain in a background thread and have full access to your main form's GUI without interruption on the vast majority of scanner models is to set CAP_INDICATORS to false and not show the UI when acquiring.
File Attachment(s):
NET - v16 - Twain in Background Thread.zip (16kb) downloaded 44 time(s).
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Wednesday, November 10, 2010 1:30:53 AM(UTC)

Adam Boulad  
Guest

Groups: Guests
Posts: 3,049

Was thanked: 1 time(s) in 1 post(s)

The attached project has 2 changes:
1. It is updated to use LEADTOOLS version 17.
2. The project now does all the Twain functions inside one thread.

The reason for the second change is that some scanners showed problems when the Twain session was created in one thread and used in a different thread.

File Attachment(s):
NET-v17-TwainInBackgroundThread.zip (11kb) downloaded 37 time(s).
 
#3 Posted : Wednesday, September 9, 2015 1:17:51 AM(UTC)

Daoud  
Daoud

Groups: Registered
Posts: 256


The attached project is updated to use LEADTOOLS v19.
File Attachment(s):
NET-v19-TwainInBackgroundThread.zip (12kb) downloaded 55 time(s).
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2017, Yet Another Forum.NET
This page was generated in 0.200 seconds.