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, November 15, 2007 12:14:40 PM(UTC)

Kevin B  
Kevin B

Groups: Registered
Posts: 14


I'm using LeadTools v15.0.0.25 on .NET 2.0 w/ C# with a Kodak i40 scanner.

When I try to set the resolution on the scanner prior to scanning my setting is ignored.  The resulting images are always at 200dpi.

However, the resolution gets set just fine when I use a Ricoh Image Scanner IS200e, so it would seem that this has something to do with the Kodak i40.

I've tried setting the resolution 4 seperate ways now, none have worked.
First way:
TwainProperties twnProps = twnSession.Properties
TwainImageResolutionProperties resProps = twnProps.ImageResolution;
resProps.HorizontalResolution = scanSetting.Resolution;
resProps.VerticalResolution = scanSetting.Resolution;
twnProps.ImageResolution = resProps;
twnSession.Properties = twnProps;

Second way:
SizeF res = session.Resolution;
res.Width = 300;
res.Height = 300;
session.Resolution = res;

Third way:
Manually setting the capability TwainCapabilityType.ImageXResolution and TwainCapabilityType.ImageYResolution

Fourth way:
Manually setting the capability TwainCapabilityType.ImageXNativeResolution and TwainCapabilityType.ImageYNativeResolution

Thanks,
Kevin Berridge
 

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 : Friday, November 16, 2007 11:18:10 AM(UTC)

jigar  
Guest

Groups: Guests
Posts: 3,022

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

Hello,

What does the twain dialog box say once you call the Acquire() method.  Does it say 200 even if you set the resolution to 300?
 
#3 Posted : Monday, November 19, 2007 11:02:07 AM(UTC)

Kevin B  
Kevin B

Groups: Registered
Posts: 14


Yes, the dialog says 200 even though I set it to 300 (or whatever).

Also, I'm using the AcquireFast call, if that makes any difference.

Thanks,
Kevin Berridge
 
#4 Posted : Tuesday, November 20, 2007 4:36:16 AM(UTC)

jigar  
Guest

Groups: Guests
Posts: 3,022

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

That could make a difference.  In the documentation it says, "Use the AcquireFast method to acquire one or more images and save them to
one or more files.  Based on the scanner type, this method will determine the best/fastest scanning method to use."

So if it's chosing the fastest scanning method it might be using 200dpi.  Use the normal Acquire() method and see what happens.
 
#5 Posted : Tuesday, November 20, 2007 7:50:04 AM(UTC)

Kevin B  
Kevin B

Groups: Registered
Posts: 14


Indeed, when I use the Acquire method the manufacturer's dialog box comes up with the correctly resolution.

This is a problem though, I need the direct to file behavior of the AcquireFast method but I also need to set my own resolution.  Can I do this?

Also, any idea why only this scanner is behaving this way?  I've tried it with two other scanners that all worked as expected.

Thanks,
Kevin
 
#6 Posted : Wednesday, November 21, 2007 7:50:44 AM(UTC)

jigar  
Guest

Groups: Guests
Posts: 3,022

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

We have an article titled "Fast TWAIN (Scan Configurations)" in our .NET documentation.  That article is an overview, but if you click the FindFastConfiguration link, it will show you how to find out the Fast TWAIN specs.

What's the default resolution on the other scanners?  Since the TwainFastConfiguration doesn't have a property for setting the DPI, I assume it is picking the default one.

Use the TwainCapabilityType to find out what the default DPI is before changing anything to the TwainSession.  Then set it to the DPI that you would like.  Call the AcquireFast() method.  After you call it, check the TwainCapabilityType to see if the DPI value has been changed.  That way we can know if AcquireFast() is changing it to whatever it sees fit.  I will try it here and then we can compare results.
 
#7 Posted : Wednesday, November 21, 2007 10:45:52 AM(UTC)

Kevin B  
Kevin B

Groups: Registered
Posts: 14


With the Kodak scanner, the default value is 200.  I set it to 300 and verify that the capability is set correctly.  Then I AcquireFast.  When I next check the capability, it's 200.  When I check the file in Microsoft Office Document Imaging the resolution is 200.

With the Ricoh scanner, the default value is 200.  I set it to 300 and verify that the capability is set correctly.  Then I AcquireFast.  When I next check the capability, it's 200.  However, when I check the file in Microsoft Office Document Imaging the resolution is 300.

I ran the Kodak through the FindFastConfiguration method as follows:
twnSession.FindFastConfiguration( "C:\\temp", TwainFastUserInterfaceFlags.Show, 0, 1, null );

It returned the following as the best configuration:
BitsPerPixel: 0
BufferSize: -1
ImageFormat: Gif
RequiredTime: 0
Success: true
TransferMechanism: File

You'll notice that there is no mention of resolution anywhere in the TwainFindFastConfigurationResult.  The Leadtools documentation also doesn't explicitly say what properties will be set as part of determining "the best scanning method."  It says it will determine this itself if you don't call FindFastConfiguration.  However, calling FindFastConfiguration causes the scanner to actually do a test scan for every single configuration, and this doesn't happen when you call AcquireFast.  So, clearly, AcquireFast is not simply calling FindFastConfiguration internally...

  1. What does it mean for AcquireFast to "determine the best scanning method"?
  2. How does acquire fast determine the best scanning method without doing test scans?
  3. Is resolution one of the properties that make up "the best scanning method?"
Those are the questions I need answered.  I'm sure someone at Leadtools must understand how AcquireFast behaves well enough to answer them.  Should I perhaps contact support through email/phone?
 
#8 Posted : Monday, November 26, 2007 8:01:19 AM(UTC)

jigar  
Guest

Groups: Guests
Posts: 3,022

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

1.  From reading the API and .NET doc, it seems to me that "best" means the fastest.

2.  Again from the API & .NET docs, AcquireFast will use the default configurations provided by the manufacture for the TWAIN driver if FindFastConfiguration is NOT called.  So, if you were to call FindFastConfiguration it would do test scans to find the fastest one.  If FindFastConfiguration is not called, then it will use the default configurations from the TWAIN driver.

3.  Resolution is not part of the configuration settings, so I am wondering why your Kodak reverts to 200.  I just tested with my Panasonic KV-S2026C, and I was able to scan an image at 600 dpi by calling AcquireFast.  I'm going to check with my TWAIN expert on this.  I will also confirm my answer to quesiton #1.
 
#9 Posted : Tuesday, November 27, 2007 10:00:53 AM(UTC)

jigar  
Guest

Groups: Guests
Posts: 3,022

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

To confirm #1, "best" does mean fastest for FindFastConfiguration().

I talked to our TWAIN expert and he said to try it with TWACKER (http://www.twain.org/devfiles/twainkit.exe).  He said that TWAIN drivers reset their settings after a scan, so our test to see if the resolution is changed after the scan didn't really help us.  So we are going to try it with Twacker and see if it does the same thing.

1) Run Twacker
2) Click File | File (checking it)
3) Click File | ShowUI (unchecking it)
4) Click Special | 1, then Special | 2, then Special | 3
5) Change MSG combobox to MSG_SET
6) Change Capabilty to ICAP_XRESOLUTION
7) Type 300 into Value Text box and press the Send button.
8) Do the same for ICAP_YRESOLUTION
9) Press the Close button.
10) Click Special | Enable/Transfer button.
11) Select a path and name for the file.
12) After it has scanned, check the file to see if it scanned using that resolution.

If the resolution for the file is still 200 that means the TWAIN driver is messing up and we'll have to contact Kodak for that.  If the resolution is 300, then we'll do more testing.
 
#10 Posted : Tuesday, November 27, 2007 12:03:06 PM(UTC)

Kevin B  
Kevin B

Groups: Registered
Posts: 14


I have good news for you but bad news for me I suspect.

I followed your directions and it scaned to 200 dpi (according to windows explorer), not 300 like I set it to.  Then I tried it with ShowUI turned on and I set the resolution through the UI, that resulted in a 200 dpi file as well...

I tried both those scenarios on a different scanner and it worked fine.  So it would appear that the problem is with the Kodak driver and not LeadTools.

Any advice on where to go from here?
 
#11 Posted : Tuesday, November 27, 2007 12:32:24 PM(UTC)

Kevin B  
Kevin B

Groups: Registered
Posts: 14


The plot thickens...

I installed the latest drivers and firmware from the Kodak website and tried again with Twacker.  At first I thought it was working, but then I noticed it scanned in color and not in black and white (like I had been doing in all the other tests).  When I changed it to black and white it stopped working again.  The same happens when I use my code that uses LeadTools.

Color - scans at my dpi setting
B/W - always scans at 200dpi

This doesn't indicate much to me, but does it indicate anything to you?
 
#12 Posted : Tuesday, November 27, 2007 12:38:33 PM(UTC)

jigar  
Guest

Groups: Guests
Posts: 3,022

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

I'll see if we can report this to Kodak.  I think we should be able to.  I forwarded your result to our TWAIN expert and he will tell me what the next step is.  This is the first time I have encountered this so I'm learning the process.  :)

EDIT:  In regards to your post above.  I think they changed the default configuration a little bit.  I guess it thinks 200dpi is enough when scanning in B&W.  I will add this to the email I sent, and get back to you.

Thanks.
 
#13 Posted : Tuesday, November 27, 2007 12:54:11 PM(UTC)

jigar  
Guest

Groups: Guests
Posts: 3,022

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

One last thing, we did get your email that you sent it.  I allowed
enough time to let other agents have a look at it to see if they knew
anything.  I currently have it in my inbox.  If you need me to reply to
that, let me know.  (I can keep you updated on the issue through email.)  If you ask questions in the forums, they will get answered in the same amount of time and attention as the emails.  So feel free to ask here or through email.

Thanks.
 
#14 Posted : Wednesday, November 28, 2007 5:28:02 AM(UTC)

Kevin B  
Kevin B

Groups: Registered
Posts: 14


Thanks for your help!  If you can keep me posted by email that would be great.

I've attempted to contact Kodak as well but so far haven't had any luck.  They certainly don't make it easy like you guys do.

Thanks again,
Kevin Berridge
 
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-2024, Yet Another Forum.NET
This page was generated in 0.166 seconds.