![]() |
![]() |
|
![]() |
TWAIN Support in ObjectPAL® Advanced Techniques © 2001 Paul Cronk Advanced Techniques In this article, the samples use some advanced techniques which should be explored while designing a TWAIN implementation. These techniques are not mandatory for any TWAIN enabled application. If the application does not employ the advanced techniques, the application will still function. Saving the Application Default Source Code should never rely on the system default source for acquisition. A straight acquire() could acquire from a different source than expected, and thus yield unexpected results. Creating and maintaining the default source for the application prevents users from acquiring from unwanted or unsupported sources. This concept can be expanded to include user default sources as well. Handling Graphics Graphics require special handling. When a graphic is read from a file, the file is converted from its original format to a native bitmap form. This is typical in other applications. In Paradox 10, graphics can be exported to disk in more compressed formats, such as GIF, and JPEG. The largest advantage of leveraging the new graphic features in Paradox 10 is size. Setting the System Default Source One trick to get the default TWAIN source without showing the Select Source dialog is to read the profile entries that correspond to the default data source. The filename is stored in the 'Default Source' entry of the 'TWAIN' section in the 'win.ini' file.strDSFileName = readProfileString( "win.ini", "TWAIN", "Default Source" )returns the complete path and filename of the system default data source. It is then left up to the developer to equate the friendly name displayed in the Select Source dialog to the filename returned from the above function. Caveats with TWAIN support in ObjectPAL With the current implementation of Paradox 10 SP1, the function twain.acquire( var gr graphic, var bShow Logical) does not work as documented. However, one could acquire to a file, then perform a graphic.readFromFile() method after the acquisition was complete to achieve the same results. Paradox 10 SP2 has corrected the behavior of the acquire method. Where can I find more information about TWAIN? The TWAIN working group can be found on the web, at www.twain.org. First: Series Content, Definitions and Requirements Previous: Sample Projects Discussion of this article |
![]() Feedback | Paradox Day | Who Uses Paradox | I Use Paradox | Downloads ![]() |
|
![]() The information provided on this Web site is not in any way sponsored or endorsed by Corel Corporation. Paradox is a registered trademark of Corel Corporation. ![]() |
|
![]() Modified: 15 May 2003 Terms of Use / Legal Disclaimer ![]() |
![]() Copyright © 2001- 2003 Paradox Community. All rights reserved. Company and product names are trademarks or registered trademarks of their respective companies. Authors hold the copyrights to their own works. Please contact the author of any article for details. ![]() |
![]() |
|