PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • 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/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
TwainState (Function)
In French: TwainEtat
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 perform an acquisition on several pages by using a TWAIN device, all you have to do is perform a loop 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.
Components
WINDEVReports and Queries wd230std.dll
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment