Scanning document with black background...

Questions, comments and suggestions concerning VintaSoft Twain .NET SDK.

Moderator: Alex

Post Reply
bharate.umesh
Posts: 20
Joined: Thu Dec 31, 2009 1:27 pm
Contact:

Scanning document with black background...

Post by bharate.umesh » Wed Jan 13, 2010 10:26 am

Alexey,

When I scan a document by setting Pixel Type as 'BW', it is scanned with black background instead of white backgrond.

Have any property for setting a scanner like 'INVERT COLOR'?

Thanks,Umesh

Alex
Site Admin
Posts: 1443
Joined: Thu Jul 10, 2008 2:21 pm

Re: Scanning document with black background...

Post by Alex » Wed Jan 13, 2010 11:34 am

Hello Umesh,

DeviceCapability.IPixelFlavor capability allows to specify value (0 or 1) of the black color.

Best regards, Alexander

bharate.umesh
Posts: 20
Joined: Thu Dec 31, 2009 1:27 pm
Contact:

Re: Scanning document with black background...

Post by bharate.umesh » Wed Jan 13, 2010 12:34 pm

Thanks Alexey.

Should I set the values as below?

VSTwain.PixelType = Vintasoft.Twain.PixelType.BW
VSTwain.Capability = DeviceCapability.IPixelFlavor

I have used Kodak i1120 Scanner, it is working fine without the above code.

It scan perfectly without black background at our place.

Our client is using Kodak i30/40 scanner.

Is the above code will work at our client place or will it scan with white background?

Please suggest your code.

Alex
Site Admin
Posts: 1443
Joined: Thu Jul 10, 2008 2:21 pm

Re: Scanning document with black background...

Post by Alex » Thu Jan 14, 2010 9:38 am

Hello,

Here is a code snippet:

Code: Select all

.....
VSTwain1.OpenDataSource()
VSTwain1.PixelType = PixelType.BW
VSTwain1.Capability = DeviceCapability.IPixelFlavor
VSTwain1.CapType = CapType.OneValue
' 0 (CHOCOLATE) - zero pixel represents darkest shade, 1 (VANILLA) - zero pixel represents lightest shade
VSTwain1.CapValue = 0
VSTwain1.SetCap()
.....
Also please try to use the Native transfer mode (VSTwain1.TransferMode = TransferMode.Native) instead of the Memory trnsfer mode and let me know results.

Best regards, Alexander

bharate.umesh
Posts: 20
Joined: Thu Dec 31, 2009 1:27 pm
Contact:

Re: Scanning document with black background...

Post by bharate.umesh » Thu Jan 14, 2010 10:56 am

Hello,

I have installed Kodak Imaging Professional on my machine.

I scan document with BW pixel type and upload to the FTP.

If I open with other windows viewer, document looks good, but if I open with Kodak, it is black background.

Thanks,Umesh

bharate.umesh
Posts: 20
Joined: Thu Dec 31, 2009 1:27 pm
Contact:

Re: Scanning document with black background...

Post by bharate.umesh » Mon Jan 18, 2010 9:05 am

Alexey,

I have added the following code when I going to scan an image.

VSTwain.IsTwain2Compatible = True

But it is showing an error, saying that " Twain DLL is not found. - at Vintasoft.Twain.StartDevice."

I've gone through the your FAQ section and found the below.

Can I use VintaSoftTwain.NET SDK in 64-bit version of Windows?

Yes, you can use VintaSoftTwain.NET SDK in 64-bit version of Windows.

Here is a list of steps that you should do:
•Download the latest version of TWAIN Data Source Manager from TWAIN web site (twaindsm-X.Y.Z.win.bin.zip file)
•Place twaindsm.dll and twaindsm32.msm (files from "twaindsm-X.Y.Z.win.bin.zip\Twain32" directory) into the "Windows\SysWow64\" directory
•Place twaindsm.dll and twaindsm64.msm (files from "twaindsm-X.Y.Z.win.bin.zip\Twain64" directory) into the "Windows\System32\" directory
•Specify path to the TWAIN Data Source Manager in your code:
...
VSTwain1.TwainDllPath = "c:\Windows\SysWow64\twaindsm.dll"
VSTwain1.IsTwain2Compatible = True
VSTwain1.StartDevice()
...

I've downloaded two folders from TWAIN website.
1) "twain 32" folder contains TWAINDSM32.msm and TWAINDSM.dll files.
2) "twain 64" folder contains TWAINDSM64.msm and TWAINDSM.dll files.

My machine is 32 bit.
I copied TWAINDSM.dll to C:\ WINDOWS \ system \ from twain 32 folder.and write the following code before VsTwain.StartDevice. ..............VsTwain.TwainDllPath = " C:\ WINDOWS \ system \ TWAINDSM.dll "VsTwain.IsTwain2Compatible = True.............

But still the image showing black background in kodak viewer.

Please provide solution on it.

Thanks,Umesh

------------------------------------------

Hello Umesh,

Thanks for your e-mail!

Yes, as it shows "TWAIN version: 2.0 and TWAIN 2.0 compatible: True" set Is= Twain2Compatible Property to true and test how it works.

Please let me know results.

Anyway do not use WIA.

bharate.umesh
Posts: 20
Joined: Thu Dec 31, 2009 1:27 pm
Contact:

Re: Scanning document with black background...

Post by bharate.umesh » Wed Jan 20, 2010 2:59 pm

Great!

Now, it is working fine.

Thanks,Umesh

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest