ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Windows functions / TWAIN functions
  • Managing the changes of pages
  • Operating mode in the 64-bit applications
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Returns the status of the current source.
nDefault is int = 0
 
// Acquisition as long as there are pages to load
nPageNum is int = 0
LOOP
// Digitalization in a BMP file
IF TwainToBMP("File" + NumToString(nPageNum + 1) + ".BMP",
False, // No user interface
nDefault, // Default image of the device
nDefault, // Default number of bits per pixel for the device
nDefault, // Default image resolution for the device
nDefault, // Default image contrast for the device
nDefault, // Default image brightness for the device
False,  // Scan the document on a single side (no duplex)
True // Optimize the automatic load in the loader
) = False THEN
BREAK
END
nPageNum ++
// More pages?
IF TwainState() = tsUnloaded THEN BREAK
END
// At least one digitized page?
IF nPageNum = 0 THEN
Error("The digitization failed", ErrorInfo())
ELSE
Info(nPageNum + "pages have been scanned")
END
Syntax
<Result> = TwainState()
<Result>: Real
Status of the Twain source corresponding to one of the following constants:
tsLoadedThe Twain manager is loaded.
tsUnloadedThe Twain manager is not loaded.
tsOpenThe Twain manager is opened.
tsSourceEnabledThe source is enabled.
tsSourceOpenThe source is opened.
tsSourceReadyThe source is ready to transfer data.
tsSourceTransferThe source is currently transferring data.
Remarks

Managing the changes of pages

To acquire several pages using a TWAIN device, all you have to do is perform a loop operation that acquires a page and that ends when TwainState returns the tsUnloaded constant. The value of the constant indicates that the page loader of the TWAIN device is empty.

Operating mode in the 64-bit applications

In a 64-bit application, this function will automatically use the 64-bit Twain driver. The TWAIN cannot be used if this driver is not installed.
Component: wd290std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help