This is in continuation of the discussion Scanning with BackgroundWorker thread ….I have attached a log file, Log.txt
, I have been using the TWAIN driver [HP Scanjet G2410 #2 TWAIN, please see the log]
for the Twain Acquisition in the BackgroundWorker thread.
The application hangs for about 15-20 minutes when it executes [code: imageId = _gdPictureImaging.TwainAcquireToGdPictureImage(IntPtr.Zero); // Acquire image ] in the BackgroundWorker Thread. In fact, it initiates scanning and engages the scanner, the lamp tube does one complete cycle, but at the end no response it just get hanged and no image is acquired.
Note : We are using WPF as a host for GDPicture.
Code: Select all
GdPicture.GdPictureImaging gdPicture = new GdPicture.GdPictureImaging();
using (BackgroundWorker worker = new BackgroundWorker())
worker.DoWork += (s, ev) =>
int imgId = gdPicture.TwainAcquireToGdPictureImage(IntPtr.Zero);
worker.RunWorkerCompleted += (s, ev) =>
Please find the solution and update as soon as possible, for your reference I have added the code and attached the Log file, Log.txt.