Holger's Java API

## com.antelmann.image
Class TwainAdapter

    java.lang.Object
      com.antelmann.image.TwainAdapter

    @NativeCode
    @ThirdParty(value="uses javajeff.mb.ca classes for twain")
    public class TwainAdapter

extends Object

uses some free software from http://www.javajeff.mb.ca/; requires jtwain.dll in the path; note that all methods must run in the AWT event thread.

Author:
  Holger Antelmann

Method Summary
`Image[]` `acquire()`
`ArrayList<Image>` `acquire(int count)`
`Image[]` `acquire(String sourceName)` acquires an image directly from the default source (the source gui is used)
`ArrayList<Image>` `acquire(String sourceName, int count)` acquires images in succession directly from the default source
`Image` `acquireImage()`
`Image` `acquireImage(String sourceName)`
`String` `getDefaultSource()`
`static TwainAdapter` `getInstance()`
`ArrayList<String>` `listSources()`
`Image[]` `requestAndAcquire()` acquires an image from the default source (the twain source gui is used for selection).

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getInstance

    public static TwainAdapter getInstance()
                                    throws ResourceNotFoundException

  Throws:
    `ResourceNotFoundException` - if the adapter cannot be initialized

### requestAndAcquire

    public Image[] requestAndAcquire()
                              throws com.antelmann.image.ImageTransferException

  acquires an image from the default source (the twain source gui is used for selection). Null may be returned if the user selects to cancel the operation.

  Throws:
    `com.antelmann.image.ImageTransferException`

### acquireImage

    public Image acquireImage()
                       throws com.antelmann.image.ImageTransferException

  Throws:
    `com.antelmann.image.ImageTransferException`

### acquireImage

    public Image acquireImage(String sourceName)
                       throws com.antelmann.image.ImageTransferException

  Throws:
    `com.antelmann.image.ImageTransferException`

### acquire

    public Image[] acquire()
                    throws com.antelmann.image.ImageTransferException

  Throws:
    `com.antelmann.image.ImageTransferException`

### acquire

    public ArrayList<Image> acquire(int count)
                             throws com.antelmann.image.ImageTransferException

  Throws:
    `com.antelmann.image.ImageTransferException`

### acquire

    public ArrayList<Image> acquire(String sourceName,
                                    int count)
                             throws com.antelmann.image.ImageTransferException

  acquires images in succession directly from the default source

  Throws:
    `com.antelmann.image.ImageTransferException`

### acquire

    public Image[] acquire(String sourceName)
                    throws com.antelmann.image.ImageTransferException

  acquires an image directly from the default source (the source gui is used)

  Throws:
    `com.antelmann.image.ImageTransferException`

### getDefaultSource

    public String getDefaultSource()
                            throws com.antelmann.image.ImageTransferException

  Throws:
    `com.antelmann.image.ImageTransferException`

### listSources

    public ArrayList<String> listSources()
                                  throws com.antelmann.image.ImageTransferException

  Throws:
    `com.antelmann.image.ImageTransferException`

(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads