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 : Sunday, March 26, 2006 9:35:33 PM(UTC)
csyemily

Groups: Registered
Posts: 9


I am trying to set an scanning template. It seems that the default template can be set by using the following method : (Here is the example of setting the default image frame for the scanning template)

' Set the Default Frame of the image for scanning
Dim twnCap As TwainCapability = New TwainCapability
Dim frame As TwainFrame = New TwainFrame
frame.LeftMargin = 2
frame.TopMargin = 2
frame.RightMargin = 2
frame.BottomMargin = 2
try
   twnCap.Information.Type = TwainCapabilityType.ImageFrames
   twnCap.Information.ContainerType = TwainContainerType.OneValue
   twnCap.OneValue.ItemType = TwainItemType.Frame
   twnCap.OneValue.Value = frame
Catch ex As Exception
   throw ex
End Try

When running the exe, the following error occurred
"Error in the status of TWAIN source" 

However, i can reset the brightness of the scanning template as follow:
, ,
Dim twnCap As TwainCapability = New TwainCapability
Dim brightness as Single
brightness = 52

try
   twnCap.Information.Type = TwainCapabilityType.ImageBrightness
   twnCap.Information.ContainerType = TwainContainerType.OneValue
   twnCap.OneValue.ItemType = TwainItemType.Fix32
   twnCap.OneValue.Value = brightness
Catch ex As Exception
   throw ex
End Try

It seems that the coding is the same except the resetting parameters.......
Do there something go wrong/ some code missing in the above program? OR
How can i reset the default setting of the scanning template ?
Please advise. Thanks.

P.S. I am using Leadtools v14.5 and vb.net (.Net Framework v1.1)

 

 

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 : Wednesday, March 29, 2006 12:07:53 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

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

To retrieve the default twain template, you may try to save the template file before calling any capabilities. And when you want to retrieve the default settings load the template file that you saved before.
For more information please refer to the LEADTOOLS DotNet documentation and read the following topics:
- TwainSession.SaveTemplateFile Method
- TwainSession.LoadTemplateFile Method

Thanks,
Maen Badwan
LEADTOOLS Technical Support

Edited by moderator Thursday, October 6, 2016 5:09:12 PM(UTC)  | Reason: Not specified

 
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-2019, Yet Another Forum.NET
This page was generated in 0.111 seconds.