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, October 8, 2007 12:08:14 PM(UTC)

mbsiehs  
mbsiehs

Groups: Registered
Posts: 28


I have an application that allows the user to choose a device from a list of devices before that device is actually used.  The information about that device is saved to a SQL database and retrieved later when needed.  For example, the user can set up to use a Twain device whenever they want to obtain an image with a digital camera.  When they go to that camera, the device is automatically selected.

I'm wanting to save various properties about the Twain device in the database, but I don't know if that's possible.  I have followed the Twain example in the documentation and used the SelectSource(), but once the source is selected I can't seem to get to it.  What am I missing?  That's the information I want to save and load later.  

Thanks for your time.
Matt
 

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 : Monday, October 8, 2007 10:50:23 PM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

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

Hello,

If you mean that you want to save the settings of the selected Twain driver to use these settings later, you can save the capability settings, used when acquiring images, in a template file.  Template files are used to store capability information for a specific TWAIN source. That way, the next time that TWAIN source is used, the corresponding template file can provide information on the capabilities used previously.
The details depend on the programming interface (COM, OCX, .Net, API, C++ Class Library, etc.) that you use.
What is the programming interface that you use?

If you mean something else, please provide me with more details about your requirements.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#3 Posted : Tuesday, October 9, 2007 3:40:27 AM(UTC)

mbsiehs  
mbsiehs

Groups: Registered
Posts: 28


Maen,

Thanks for the quick response.

I'm developing in C# on the .NET framework with Leadtools RasterImaging Pro v 15 (although we're about to upgrade to medical).

My users are typically doctors who expect a high degree of setup done before they use my application in order to make things more efficient for them.  Because of that, my application has a setup area where, for each type of device (camera, scanner, etc.) I need to allow them to pre-load the Twain driver associated with that type of device.  That way when the doctor chooses a "camera template" all he/she has to do is activate a capture button and everything the capture happens -- the Twain device is already pre-selected.

My understanding of your response above is that when the user selects a Twain device, the selected settings of the selection can be saved to a template file.  That sounds like it's just what I need in my setup area -- I'll save that information to my database (our architrecture does not really support the saving of files).  I pop up the Leadtools source selection dialog like in your Twain example, but I want to get the selected information to store for later use.

If you could give me a pointer as to where to begin with this functionality, I'd appreciate it.

Thanks again for your time.
Matt
 
#4 Posted : Wednesday, October 10, 2007 12:08:40 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

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

Hello,

You can use the SaveTemplateFile Method to enumerate all supported capabilities, and the current values, for the currently selected TWAIN source and save them to the specified template file.

Also, you can handle the SaveTemplate Event. This event fires when you call the SaveTemplateFile method.

You can also display the TWAIN source manufacturer's template dialog by using the ShowTemplateDialog Method. You can pass the name of the file in which to save the capabilities of the selected source, if the OK (or SCAN) button is pressed.

After saving any temple file, you can load it by using the LoadTemplateFile Method. This method loads the TWAIN capability values stored in the specified template file and sets the selected TWAIN source using these values.

Please let me know if this helps.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#5 Posted : Tuesday, October 16, 2007 6:32:37 AM(UTC)

mbsiehs  
mbsiehs

Groups: Registered
Posts: 28


Maen,

I don't have the file system available to me because of architectural constraints.  Using the solution above I would need SaveTemplateStream() and LoadTemplateStream() methods.

My current working solution is to get the properties of the selected twain device via a TwainSourceInformation object that is selected by the user during the setup phase.  That gives me the device name, manufacturer and product family.  For the given template type (camera, scanner, etc.) I save that information.  When the user activates a TWAIN template (outside of setup), I call TwainSession's Acquire() method to get the image.  I think Leadtools used to have a method SetAcquireSourceName() a while back but I think it's depricated.  Nevertheless I need to know how to do just that -- set the acquire source name before I call Acquire().  Is there a method to do that?

My ideal solution would be for there to be a way to save/load the device information to/from a stream.  Otherwise I'll use the name, but that's a little less exact and therefore less safe.

I appreciate your time in helping me resolve this.

Matt
 
#6 Posted : Wednesday, October 17, 2007 6:02:39 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

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

Hello,

If you mean you want to set the name of the twain source before calling the Acquire Method, you can use the SelectSource Method.

If you mean something else, please let me know.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
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-2024, Yet Another Forum.NET
This page was generated in 0.118 seconds.