TwainSetPixelType - What is the value for "Automatic"?

Discussions about TWAIN scanning in GdPicture.NET using GdPictureImaging.
Post Reply
Starceaker
Posts: 7
Joined: Tue Nov 05, 2013 4:38 pm

TwainSetPixelType - What is the value for "Automatic"?

Post by Starceaker » Tue Nov 05, 2013 4:57 pm

We recently bought a license for GdPicture.NET 10.
I am working together with another developer to implement GdPicture to replace an old scan component.

Could you tell me what the value should be to set the PixelType to automatic? I don't see this in the documentation:

http://guides.gdpicture.com/content/fra ... lType.html

Please check the attachment, in which you will see the "Auto Detect Color" option:
Color detection mode.png
I can access all the other options through one of the PixelType values but the automatic one won't work.
I have tried:

null
-1
99 (wanted to test outside the range of the given constants)

Cedric
Posts: 263
Joined: Sun Sep 02, 2012 7:30 pm

Re: TwainSetPixelType - What is the value for "Automatic"?

Post by Cedric » Thu Nov 07, 2013 11:41 am

Since GdPicture.NET accesses to the TWAIN Data Source Manager only, it cannot have any control over the drivers generated settings window so there is absolutely no relation between what you set in your code and what you see and set in the drivers settings window.
Anyway "Auto Detect Color" isn't a PixelType in the first place, it is obviously one of the other choices and it is automatically identified by the scanner own software.
So either you hide the driver UI and set the values in your code or you show the driver UI and let the user set the values in it but you definitely cannot do both.
If you want to do the exact same thing in your source code only, you should consider our Color Detection plugin (here: http://www.gdpicture.com/products/plugi ... ection.php ).

User avatar
Loïc
Site Admin
Posts: 5594
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: TwainSetPixelType - What is the value for "Automatic"?

Post by Loïc » Thu Nov 07, 2013 11:55 am

Hello,

Some additional information:

If your TWAIN device supports automatic color detection capability you should be able to enable it by setting the ICAP_AUTOMATICCOLORENABLED cap to 1.

Here a vb example:

Code: Select all

Imaging1.TwainSetCapCurrentNumeric(TwainCapabilities.ICAP_AUTOMATICCOLORENABLED, Imaging1.TwainGetCapItemType(TwainCapabilities.ICAP_AUTOMATICCOLORENABLED), 1)
Hope this helps!

With best regards,

Loïc

Starceaker
Posts: 7
Joined: Tue Nov 05, 2013 4:38 pm

Re: TwainSetPixelType - What is the value for "Automatic"?

Post by Starceaker » Thu Nov 07, 2013 12:27 pm

Thank you both for the feedback. I will continue with your suggestions.

Starceaker
Posts: 7
Joined: Tue Nov 05, 2013 4:38 pm

Re: TwainSetPixelType - What is the value for "Automatic"?

Post by Starceaker » Thu Nov 07, 2013 3:42 pm

Thanks a lot Loïc! Your suggestion worked without any problem.

If the scanner doesn't support automatic color detection I guess it will default to it's own default value.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests