LEADTOOLS Support
Imaging
Imaging SDK Questions
Drop out colors using Twain Canon 9080 scanner
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Friday, November 10, 2006 5:11:17 AM(UTC)
Groups: Registered
Posts: 9
Hi
I need to implement a Visual Basic 8 (.net 2005) function to drop out the colors using the Canon 9080 scanner by the Twain.
I've tried to use the ImageFilter capability, but I've got an error
"Required capability not supported", but I know that scanner supports
the color image filter, in fact I can drop out the colors by using the
Twain user interface by the Windows application Imaging.
This is the method I've used to get the filter value:
twGetCapability As TwainCapability =
twnSession.GetCapability(TwainCapabilityType.ImageImageFilter,
TwainGetCapabilityMode.GetCurrent)
I've also used:
twGetCapability As TwainCapability =
twnSession.GetCapability(TwainCapabilityType.ImageFilter,
TwainGetCapabilityMode.GetCurrent)
but I've got the same error.
What I need is to set and get the color filter values scanning images
in B/W, without using the twain user interface, by Leadtools 14 and
Visual Basic 2005.
Could anyone give me an example?
Thanks
Cris
#2
Posted
:
Sunday, November 12, 2006 4:01:51 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
To make that your scanner supports the ICAP_IMAGEFILTER
capability, please check using the Twacker application from the Twain working
group. If you don't have it, you can get it from:
http://www.twain.org/devfiles/twack.zip.
Do you mean that you are trying to scan your
documents or images and save the result in black and white? Please provide me
with more details on what you are trying to do.
#3
Posted
:
Sunday, November 12, 2006 9:53:37 PM(UTC)
Groups: Registered
Posts: 9
Hi,
Yes, my aim is to scan images in black and white removing red (or green
or blu) and than saving the image in black and white.
#4
Posted
:
Sunday, November 12, 2006 10:12:03 PM(UTC)
Groups: Registered
Posts: 9
Hi
I've checked using the Twacker, and opening the Twain user interface
and selecting the red filter, the scanner remove the color red by
scanning in black and white. So it should support the image filter
capability.
My problem is to be able to implement the image filter from VB .NET (2005), without opening the Twain user interface.
Cris
#5
Posted
:
Monday, November 13, 2006 4:44:07 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
In the Twacker program, did you use the dialog with
the values shown in the attached image? If yes, and it returns a success code,
you should be able to use the GetCapability() method with
TwainCapabilityType.ImageFilter.
I didn't test here because I don't have the same
scanner model.
Guest attached the following image(s):
#6
Posted
:
Thursday, November 16, 2006 10:14:56 PM(UTC)
Groups: Registered
Posts: 9
I've used the dialog you told me. Selecting ICAP_FILTER and than clicking Send I've got a message:
Operation: DG_CONTROL/DAT_IDENTITY/MSG_OPENDS
Return Code: TWRC_FAILURE
Condition Code:TWCC_SUCCESS
and than the message with the title Capabilities:
Failed to open DS
In the open Window, under the text Returned there is :
TWRC_FAILURE -- TWCC_SUCCESS
Clickin Status I've got the message:
Condition Code TWCC_SUCCESS
Wath's the meaning of these messages?
Have I to consider success or failure?
If I want to scan a document removing the red color and than save two
images, one B/W without the red part and one in B/W with the red part
black, do you think it could be possible?
Thanks.
Cris
#7
Posted
:
Sunday, November 19, 2006 12:57:27 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
The Twacker application is a standard utility from
the Twain working group. If it returns an error while trying to open the Data
Source, this indicates either a problem in the Twain driver, or that the driver
does not support the feature you're trying to access. I suggest you try to
contact the driver's vendors.
#8
Posted
:
Monday, November 20, 2006 1:14:20 AM(UTC)
Groups: Registered
Posts: 9
When I use the Twain user interface supplied with the Canon scanner I
can select the color filter I need in the Color drop out combo
boxes (see picture attached).
That meens the drop out color feature is supported in the Canon Twain
driver, so it should be possible to access that feature even in my
application, but I don't know how to do it, yet.
Is there any method I could use with Leadtools capabilities?
Thanks
Cris
cris1771 attached the following image(s):
#9
Posted
:
Monday, November 20, 2006 4:19:38 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
Using the "twaker.exe" and your scanner
driver, use the "CAP_SUPPORTEDCAPS" capability to retrieve all the
capabilities supported by your driver. Copy all the capabilities from the field
titled "Structure:" and send them to me.
#10
Posted
:
Wednesday, November 22, 2006 2:35:57 AM(UTC)
Groups: Registered
Posts: 9
I used the "twacker.exe" with the scanner selecting "CAP_SUPPORTEDCAPS" as you can see in the attached picture, but I've got nothing in the field Structure. I've got 2 message boxes: one titled "Operation Status" with the message:
"Operation: DG_CONTROLDAT/MGS_OPENDS
Return code: TWRC_FAILURE
Condition Code: TWCC_SUCCESS"
The other message titled "Capabilities", "Failed to open DS".
I've also tried selecting several option as Container (TWON_ENUMERATION, etc..), but I don't get any value.
It seems the twacker doesn't work properly with the twain driver I have, does it?
cris1771 attached the following image(s):
#11
Posted
:
Wednesday, November 22, 2006 5:36:12 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
The Twain specification document states that the CAP_SUPPORTEDCAPS
capability is required by All Sources. Furthermore, the Twacker program is the
standard test tool for all Twain drivers. This means if it cannot retrieve
these values from your driver, the driver most likely violates the standard.
Did you try to contact the vendor or obtain an
updated version of the driver?
#12
Posted
:
Wednesday, November 22, 2006 6:23:04 AM(UTC)
Groups: Registered
Posts: 9
No, I didn't, but I can check on Canon web site and look for another driver
Thanks
Cris
#13
Posted
:
Wednesday, November 22, 2006 10:40:32 PM(UTC)
Groups: Registered
Posts: 9
I tried with a new version of the Canon driver, but I've got the same results from twacker.exe. I've also tried with another scanner (Fujitsu fi-4120C) and twacker.exe returns the same errors. The difference between Canon and Fujitsu Twain is that I can get the image filter capability and drop out the colors using Leadtools (and Twain capabilities) with Fujitsu 4120, while I can't with the Canon Twain.
That's the code I use with fujitsu to get the ImageFilter capability (it's written in c# instead of VB net):
using Leadtools.Twain;
private void Form1_Load(object sender, System.EventArgs e)
{
try
{
ShowWindowAsync(this.Handle,SW_HIDE);
_twainSession.Startup(this, "Exetesis", ".NET Application", "Version 14", "Sample");
TwainCapability twCap1;
twCap1 = _twainSession.GetCapability(TwainCapabilityType.ImageFilter, TwainGetCapabilityMode.GetCurrent);
switch(Convert.ToInt32(twCap1.OneValue.Value))
{
case 0:
WriteInfo("red");
break;
case 1:
WriteInfo("green");
break;
case 2:
WriteInfo("blu");
break;
}
_twainSession.Shutdown();
Application.Exit();
}
catch (Exception ex)
{
_twainSession.Shutdown();
MessageBox.Show(ex.Message);
Application.Exit();
}
}
WriteInfo writes info in a text file.
#14
Posted
:
Thursday, November 23, 2006 12:59:48 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
If Twacker fails with 2 different scanners to get
the SUPPORTED CAPS values, this could mean there's a problem in one (or more)
of several things:
1. Both Twain drivers.
2. Your PC's Twain Source Manager.
3. The Twacker program itself.
However, option 3 is very unlikely, and the most
probable causes are problems in the Twain drivers. I tested here using Twacker
and 5 different Twain drivers. Four of them worked correctly with the
SUPPORTEDCAPS capability, and one of them caused an application error and
crashed Twacker (both on Windows 2000 and Windows XP). For this small
(statically insignificant!) sample, 20% of drivers seem to have problems. In
your case, it's 100% unfortunately.
In short, if it doesn't work with Twacker, it will
not work with LEADTOOLS because we follow the same standard set by the Twain
Working Group, the people who wrote Twacker and wrote Twain itself.
#15
Posted
:
Thursday, November 23, 2006 11:16:36 PM(UTC)
Groups: Registered
Posts: 9
What's odd is that Leadtools works with Fujitsu's Twain driver I have (using Visual Studio 2003), but twacker does not (both in windows 2000 and Windows Xp).
Anyway thanks a lot for your support.
Cris
LEADTOOLS Support
Imaging
Imaging SDK Questions
Drop out colors using Twain Canon 9080 scanner
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.