PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Definition
  • Which document is retrieved?
  • User interface
  • Principle
  • Retrieving a document coming from a Twain device
  • Managing the duplex scanners
  • 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
Retrieving documents coming from Twain devices
Overview
Several WINDEV functions allow you to retrieve documents from a Twain device. Twain is a standard used by the devices for capturing images.
Examples of devices supporting the Twain standard:
  • scanner,
  • web camera,
  • digital camera.
When installing a Twain device, specific DLLs are installed: the DLLs for managing the Twain layer. These DLLs are required to use the Twain functions of WLanguage.
Definition

Which document is retrieved?

When using the Twain functions, the document retrieved corresponds to:
  • the document found in a scanner.
  • the image broadcasted by a "web camera".
  • the first photo saved in a digital camera.
    Note: If the user interface is used, the document retrieved will correspond to the photo selected by the user. If several photos are selected, only the first selected photo will be retrieved.

User interface

The functions for retrieving a document are used to:
  • program the retrieval of the document.
  • start the user interface of the Twain device used. The user interface corresponds to the main window of the software associated with the Twain device. This interface allows you to save the document, modify the default parameters of the device, ... The available actions depend on the device used.
Principle

Retrieving a document coming from a Twain device

To retrieve a document coming from a Twain device:
  1. Define (if necessary) the Twain device to use:
    Versions 09 and later
    TwainCurrentSource
    New in version 09
    TwainCurrentSource
    TwainCurrentSource
    Allows you to find out and change the Twain device used by default.
    Versions 09 and later
    TwainListSource
    New in version 09
    TwainListSource
    TwainListSource
    Returns the list of drivers for the Twain devices connected to the current computer.
    Versions 09 and later
    TwainSelectSource
    New in version 09
    TwainSelectSource
    TwainSelectSource
    Displays a standard dialog box used to list the different Twain devices available on the current computer.
  2. If the Twain device used corresponds to a scanner, the area to scan can be defined by TwainScanZone.
  3. Retrieve the width and height of the document to capture (by a Twain device).
    Versions 09 and later
    TwainSourceHeight
    New in version 09
    TwainSourceHeight
    TwainSourceHeight
    Returns the height (in millimeters) of the document captured by a Twain device.
    Versions 09 and later
    TwainSourceWidth
    New in version 09
    TwainSourceWidth
    TwainSourceWidth
    Returns the width (in millimeters) of the document captured by a Twain device.
  4. Retrieve the document coming from a Twain device.
    Versions 09 and later
    TwainToBMP
    New in version 09
    TwainToBMP
    TwainToBMP
    Used to:
    • save the document coming from the Twain device in a Bitmap file (".BMP" extension).
    • view the document coming from the Twain device in the user interface of device.
    Versions 09 and later
    TwainToClipboard
    New in version 09
    TwainToClipboard
    TwainToClipboard
    Used to:
    • copy the document coming from the Twain device into the clipboard.
    • view the document coming from the Twain device in the user interface of device.
    Versions 09 and later
    TwainToControl
    New in version 09
    TwainToControl
    TwainToControl
    Used to :
    • view the document coming from the Twain device in an Image control.
    • view the document coming from the Twain device in the user interface of device.
    Versions 09 and later
    TwainToGIF
    New in version 09
    TwainToGIF
    TwainToGIF
    Used to:
    • save the document coming from the Twain device in a GIF file.
    • view the document coming from the Twain device in the user interface of device.
    Versions 09 and later
    TwainToJPEG
    New in version 09
    TwainToJPEG
    TwainToJPEG
    Used to:
    • save the document coming from the Twain device in a JPEG file.
    • view the document coming from the Twain device in the user interface of device.
Note: These functions can also be used to start the user interface of the Twain device used. You have the ability to specify whether the scanner must use the "duplex" mode.

Managing the duplex scanners

If the scanner supports the duplex mode, you have the ability to perform a double-sided scan. The generated document contains both sides of the scanned document.
Note: Depending on the hardware used, the Twain driver may not be sufficient to support a double-sided scan. You may have to install additional drivers supplied by the manufacturer.

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.
Related Examples:
WD Scanner - Twain Complete examples (WINDEV): WD Scanner - Twain
[ + ] This example presents the management of devices compatible with the TWAIN standard (scanner, WebCam, digital camera, and so on) of WINDEV.

Summary of the example supplied with WINDEV:
This example presents the use of the TWAINxxx functions via digitizing application. This example is used to:
- preview a section
- digitize a document (gif, jpeg or bmp format)
- digitize a document and copy it to the clipboard
- digitize a document and print it
TWAIN: digitizing Unit examples (WINDEV): TWAIN: digitizing
[ + ] Using a Twain device (scanner, digital camera, etc.):
- Select the device used
- Digitize a document in file format (BMP, GIF or JPEG)
- Digitize a document and display it in an Image control
- Digitize a document and store it in the clipboard
WD Photocopier Sample components (WINDEV): WD Photocopier
[ + ] This component can be used in two modes:
- With an interface used to define some parameters such as the lightness or the number of copies.
- Without interface. The parameters of the computer will be used by default. You also have the ability to pass custom parameters
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment