There are no values returned.
Source.GetIdentity()
Returns a dictionary containing the configuration information for the
Data Source.
Source.GetSourceName()
Returns the name of the source. This value can be used for re-connecting
to the source at a later time.
Source.GetImageInfo()
This method returns information about the image. It can only be called
in state 6, i.e. after the image is available in the Data Source. There is
no matching 'Set' method for this call. These items have to be set using the
Capabilities functionality.
The following items are returned in a dictionary:
XResolution, YResolution, ImageWidth, ImageLength, SamplesPerPixel,
BitsPerSample, BitsPerPixel, Planar, PixelType, Compression
Source.GetImageLayout()
This method returns the layout about the image. It can only be called
in state 4 or 6, i.e. before or after the image is available in the Data
Source.
The values are returned as a tuple as follows:
((left, top, right, bottom) document_number, page_number, frame_number)
Source.SetImageLayout()
This method sets the layout about the image. In particular, it is used to select
the image, when the Source user interface is not displayed. It can only be called
in state 4, i.e. before the image is available in the Data Source.
Note, that the actual image may differ from the one you requested. Check the
Layout again after the image is available.
Name |
Description |
Default Value |
Frame |
The frame of the image. This is a tuple of four floats, representing
the (left, top, right, bottom) positions. The units are in the current
units for the source. |
mandatory |
DocumentNumber |
Integer Document Number. |
mandatory |
PageNumber |
Integer Page Number. |
mandatory |
FrameNumber |
Integer Frame Number |
mandatory |
Source.XferImageNatively()
This method is used to retrieve the image from the data source.
The 'native' form of image transfer, is a windows specific mechanism
where the data is placed in the Global Heap and a handle is passed back
to our application.
This method returns two values, a Global Heap handle and a count of the
number of items pending with the source. The data can be accessed using the
GlobalHandle* methods in the twain module. The handle must be freed by your
application using the twain.GlobalHandleFree() method. Otherwise it will
remain unavailable to windows after your process exits.
Source.XferImageByFile()
This method is used to retrieve the image from the data source.
This file name and format should have been previously defined by
the SetXferFileName() method.
Source.GetXferFileName()
This call returns the name of the transfer file, which is currently configured
in the data source. The call returns two values, the file name and the
file format, which is one of the TWFF_* constants.
Source.SetXferFileName()
This call sets the name of the transfer file. If there is no path, the
file should be created in the application current directory.
, which is currently configured
in the data source. The call returns two values, the file name and the
file format, which is one of the TWFF_* constants.
Name |
Description |
Default Value |
Filename |
The name of the file. f there is no path, the
file should be created in the application current directory. |
mandatory |
File Type |
An integer describing the file format. One of the TWFF_* constants. |
Current value is unchanged. |
Source.CancelOnePendingXfer()
This method is used to cancel the current transfer. It may only be invoked
when an image is available in the data source. The number of pending transfers
is returned.
Source.CancelAllPendingXfers()
This method is used to cancel all transfer pending in the source. It may only
be invoked when an image is available in the data source.
Source.HideUI()
This method is used to hide the user interface, which may have been displayed
previously by a call to Source.RequestAquire(). This call may not be made
while there are pending transfers in the data source. If there are pending
images, call Source.CancelAllPendingXfers() first.
Source.destroy()
This method is used disconnect the Source object from the TWAIN source.
This method is called automatically from the destructor. It is provided
as a separate method to allow finer grained control over the disconnect
process.