TWAIN ActiveX Control, Plug-in, Scanner SDK, Component, HTTP Control/SDK

Dynamsoft TWAIN Products

Support Community for TWAIN Control/Component/SDK for Scanning Solutions
* Login   * Register
* FAQ    * Search

It is currently Sun May 20, 2012 3:15 pm




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Image does not change.
PostPosted: Sat Feb 09, 2008 7:43 am 
Offline

Joined: Sat Feb 09, 2008 7:22 am
Posts: 3
Hi,
We have been using DT for quite a while in our VB 6.0 application. Now we want move to .Net/C#. We are using the DT 4.1 ActiveX that we purchased earlier for this purpose. However we are facing a few difficulties in Visual Studio 2008.

Our application should display the image in a picturebox control as each page is a scanned. But this doesn't happen with the following code. It shows only the last image when the scanning is completed. How do I show the images as I scan the pages? Please help. Below is the code segment we use now.

[code]
private void TwainHandler_OnPostTransfer(object sender, EventArgs e)
{
if (scannedImage.Image != null)
{
scannedImage.Image.Dispose();
scannedImage.Image = null;
}
scannedImage.Image = TwainHandler.Picture;
// Thread.Sleep(2000); //Added for testing only
GC.Collect();
}
[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 09, 2008 9:44 pm 
Offline
User avatar

Joined: Mon Mar 07, 2005 11:11 pm
Posts: 866
> Our application should display the image in a picturebox control as each page is a scanned.
> It shows only the last image when the scanning is completed.

Dynamic TWAIN can not keep the scanned images in buffer. If you want to view the scanned image before saving or uploading them, you can use Dynamic Web TWAIN.

Here is the online demo of Dynamic Web TWAIN. Please have a try and see if it fulfills your requirements.

http://www.dynamsoft.com/Products/WebTW ... ype=ASPNET

Thanks.

_________________
Robert
TWAIN Support Team
http://www.dynamsoft.com/
TWAIN ActiveX/Plug-in HTTP Control/SDK & TWAIN ActiveX Control, Scanner SDK, Component
Software Configuration Management | SCM Solution


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 10, 2008 7:40 pm 
Offline

Joined: Sat Feb 09, 2008 7:22 am
Posts: 3
Agreed. But we are using this control(4.1) in our VB 6.0 application and this works quite fine there. We are now porting to C# where we face this problem. Also, tried first saving the image to disk and then loading it from disk to a stream and finally showing the image in the picture box using the stream. In this case also, only the last page is shown no matter how many pages I scan. Also, no image is displayed until all the pages are scanned.
The following code also doesn't work. In the case also, only the last page is displayed in the picturebox. Please help.

[code]
private void TwainHandler_OnPostTransfer(object sender, EventArgs e)
{
String _fileName = null;
_fileName = @"c:\images\" + new Random().Next(100000).ToString() + ".tif";
TwainHandler.SaveAsTIFF(_filename);
pictureBox1.Image = Image.FromFile(_filename);
GC.Collect();
}[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 10, 2008 7:51 pm 
Offline

Joined: Sat Feb 09, 2008 7:22 am
Posts: 3
Sorry, the code I posted contain a few typos. The actual code is as shown below.

[code]
private void TwainHandler_OnPostTransfer(object sender, EventArgs e)
{
String _fileName = null;
_fileName = @"c:\images\" + new Random().Next(100000).ToString() + ".tif";
TwainHandler.SaveAsTIFF(_fileName );
pictureBox1.Image = Image.FromFile(_fileName );
GC.Collect();
}

Thanks[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 12, 2008 3:19 am 
Offline
User avatar

Joined: Mon Mar 07, 2005 11:11 pm
Posts: 866
Our support team is looking into your issue. I will get you back soon.

Thanks.

_________________
Robert
TWAIN Support Team
http://www.dynamsoft.com/
TWAIN ActiveX/Plug-in HTTP Control/SDK & TWAIN ActiveX Control, Scanner SDK, Component
Software Configuration Management | SCM Solution


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 16, 2008 11:32 pm 
Offline
User avatar

Joined: Mon Mar 07, 2005 11:11 pm
Posts: 866
We have sent a simple sample of Dynamic TWAIN to you. Please test it and let us know if it works for you.

Thanks.

_________________
Robert
TWAIN Support Team
http://www.dynamsoft.com/
TWAIN ActiveX/Plug-in HTTP Control/SDK & TWAIN ActiveX Control, Scanner SDK, Component
Software Configuration Management | SCM Solution


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

It is currently Sun May 20, 2012 3:15 pm


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Copyright © 2010 Dynamsoft Corporation. All Rights Reserved. | Knowledge Base | Source Control Blog