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 : Monday, November 1, 2010 10:50:00 PM(UTC)

tthon  
tthon

Groups: Registered
Posts: 6


I am using Lead Tool version 16.

I try to set the scan quality (200dpi) with the in VB6 code below and it hit "Invalid Capability Value". I have checked that it supports the ICAP_XRESOLUTION and ICAP_YRESOLUTION.

Is there any of the value is wrongly set?

    Set twCap = New TwainCapability
    twCap.Information.ContainerType = TwainContainerType_OneValue
    twCap.Information.Type = TwainCapabilityType_ImageYResolution
    twCap.OneValueCapability.itemType = TwainItemType_Fix32
    twCap.OneValueCapability.Value.IntegerValue = 200
    Call MyTwainSession.SetCapability(twCap, TwainSetCapabilityMode_Set)

    twCap.Information.Type = TwainCapabilityType_ImageXResolution
    twCap.OneValueCapability.itemType = TwainItemType_Fix32
    twCap.OneValueCapability.Value.IntegerValue = 200
    Call MyTwainSession.SetCapability(twCap, TwainSetCapabilityMode_Set)
tthon attached the following image(s):
Support_Cap.jpg
 

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 : Tuesday, November 2, 2010 6:38:50 AM(UTC)

Adam Boulad  
Guest

Groups: Guests
Posts: 3,034

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

Use the following code to set the X resolution and Y resolution values:
'================
Dim twCap As TwainCapability
Dim data As New TwainItemValue
Set twCap = New TwainCapability
data.itemType = TwainItemType_Fix32
data.FloatValue = 200
twCap.Information.ContainerType = TwainContainerType.TwainContainerType_OneValue
twCap.Information.Type = TwainCapabilityType_ImageYResolution
twCap.OneValueCapability.itemType = TwainItemType_Fix32
Set twCap.OneValueCapability.Value = data
twnSession.SetCapability twCap, TwainSetCapabilityMode_Set

twCap.Information.Type = TwainCapabilityType_ImageXResolution
Set twCap.OneValueCapability.Value = data
twnSession.SetCapability twCap, TwainSetCapabilityMode_Set
'================

If you face the same error, try to use the Twain device using the standard Twain test utility from the Twain Working Group. This program is called Twacker and you can get it from here: http://www.twain.org/devfiles/twack.zip

Use the Twacker to get the supported DPI values by the device and see if it supports 200.
 
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-2020, Yet Another Forum.NET
This page was generated in 0.148 seconds.