EZTwainX ::  Technical Reference :: Methods
Overview  Download  How To Buy  Demo  Code Examples  Technical Reference
See also: creation, properties, events, deployment

 

Method Name Description Ver.
AcquireMultipage() => bool Acquire multiple pages and store them in the control. 1.40
AcquireMultipageFile([in] BSTR filename) => bool Scan multiple pages directly into a file, using the current scan settings. The format of the file is deduced from the file extension, which must be one of the supported multipage formats: TIFF (.tif, .tiff, .mpt), PDF, or DCX. This method has no effect on the images (if any) currently stored in the control, and does not load the scanned images into the control. 1.40
AcquireSingleImage() => bool Acquire a single image from the source device and store it in the control. 1.39
AppendDibHandle(long hdib)

Append the image stored in a DIB handle (global handle pointing to a contiguous memory DIB).
The EZTwainX control takes ownership of the DIB: Do not use the handle again - calling any other function on that handle may cause a crash.

1.45
AutoContrast Adjust the contrast and brightness of the current image to make it 'better'. 1.45
AutoCrop Crop the current image using a heuristic: Try to trim off areas of uniform color while keeping content. 1.44
ChooseSystemTwainDevice() => bool Display the TWAIN 'Select Source' dialog to allow user to specify default TWAIN device.
Note: This selects the default TWAIN device for the entire computer, not just for your application.
1.39
Clear() Delete all images held by the control. 1.42
CloseDevice Close the currently open TWAIN device, if any. 1.44
Crop(long x, long y, long w, long h) Replace the current image with a copy cropped to the given rectangle. x and y are the pixel coordinates of the upper left corner, w and h are the pixel width and height. Note that x or y can be negative. If the source rectangle extends outside the current image, the additional pixels are sourced as white. 1.43
DeletePage(long i) Delete the ith image (counting from 0) held by the control.
i=-1 means delete the last image, etc. (Pythonistas will recognize this convention.)
1.36
DeletePages(long i, long n) Delete n images starting with the ith image (counting from 0) held by the control.
i=-1 means starting from the last image, etc.
If n < 0, deletes abs(n) images preceding the ith image.
1.36
Deskew Automatically deskew the current image. 1.44
EditCopy() => bool Copy the current image to the clipboard. 1.41
EditPaste() => bool If the clipboard contains an image, copy it into the control, replacing any current images. 1.41
FlipHorizontal() Flip current image horizontally. 1.40
FlipVertical() Flip current image vertically. 1.40
InsertFromFile(long i, BSTR filename) => bool Insert the images in the file into the control, starting at position i. 0=first image, -1 means 'at the end'. 1.44
InsertPagesFromFile(
long i, BSTR filename,
long p, long n) => bool
Insert n images starting at position p in a file, into the control starting at position i. Positions begin at 0, -1 means 'last', and n=-1 means 'all'. 1.44
IsFeederLoaded()=>bool Check the current device and return True if paper is detected in the feeder. Return False if no scanner can be opened, or it does not have a feeder, or cannot detect paper. This method leaves the scanner open - until you do an Acquire, or call CloseDevice. 1.44
KeepCurrentPages() (Deprecated - use AccumulateImages property instead.) The next method call that would normally clear the control, does not - any images in the control are kept, and any new images are added: Applies to Acquire methods, Load methods, and EditPaste. 1.48
-1.49
LoadFromFile(BSTR filename)
=> bool
Load image(s) from the file into the control. If filename is empty, prompts the user. 1.40
LoadPagesFromFile(BSTR filename, long i, long n)
=> bool
Load n pages into the control starting at the ith page in the file. If n = -1, loads as many as possible. 1.41
Negate() Negate (reverse colors) in the current image. 1.55
NextPage() => bool Select and display the next image in the control. (same as PageIndex = PageIndex+1) 1.40
PrevPage() => bool Select and display the previous image in the control. 1.40
PrintToDefault(BSTR jobname) => bool Print image(s) immediately to the default printer, without displaying a print dialog. 1.41
PrintWithDialog(BSTR jobname) => bool Print image(s) using the standard print dialog. 1.41
RecognizeText => BSTR Recognize (OCR) and return text in the current image/page.
Requires Transym TOCR be installed on client computer.
1.56
ResetTrialLicense Display a dialog allowing a Trial License Extension key to be entered. 1.36
Rotate180() Rotate current image 180 degrees. 1.40
RotateClockwise90() Rotate current image clockwise 90 degrees. 1.40
RotateLeft(double d) Rotate the current image left (counter-clockwise) by d degrees. d must be a multiple of 90.
Changed to take an angle (double) in degrees:
1.36
1.41
RotateRight(double d) Rotate the current image right (clockwise) by d degrees. d must be a multiple of 90.
Changed to take an angle (double) in degrees:
1.36
1.41
SavePageToFile(BSTR filename) => bool Save the current image to a file. Because this method always writes exactly one image, it can save to any supported format: BMP, DCX, GIF, JPEG (JPG), PDF, PNG, or TIFF. If the filename is null, the user will be presented with a standard File-Save dialog. 1.43
SavePagesToFile(
long i, long n, BSTR filename) => bool
Save n images starting with image i to a file. EZTwainX deduces the format from the extension of the file: .bmp, .gif, .jpg, .pdf, etc. If n > 1, the format must be a supported multipage format: TIFF, PDF, or DCX.
If the filename is null, the user will be presented with a standard File-Save dialog.
1.43
SaveToFile(BSTR filename) => bool Save all images to file. EZTwainX deduces the format from the extension of the file: .bmp, .gif, .jpg, .pdf, etc. If PageCount > 1, the format must be a supported multipage format: TIFF, PDF, or DCX.
If the filename is null, the user will be presented with a standard File-Save dialog.
1.39
SelectImage(long i) Select the ith image (from 0) in the control as the active image. 1.55
UploadAddCookie(BSTR cookie) Add a 'cookie' HTTP header to the next upload i.e. a header of the form Cookie: cookie 1.57
UploadAddHeader(BSTR hdrline) Add an HTTP header line to the next upload. To send cookies for authentication, use UploadAddCookie. 1.55
UploadExtraField(
BSTR name, BSTR value)
Add the given field (item,value) to the form submitted by the next Upload. This can be used to send information to the server about the file or files being uploaded. See UploadToURL below. 1.48
UploadToURL(
BSTR url,
BSTR filename,
BSTR field) => bool
Upload the contents (all images) of the control to the script specified by url. Use HTTP-POST, and pretend that the data is a file of the specified name. The transferred file is formatted based on the filename extension: .jpg, .gif, .tif, .pdf, etc. This method simulates the action of a user submitting a form whose ACTION=url, containing a file-upload field. EZTwainX 1.49 adds support for secure uploads using SSL/HTTPS. See Uploading. 1.46
1.49+
UploadSeparatelyToURL(
BSTR url,
BSTR filename,
BSTR field) => bool
Upload all images in the control as separate file-items to the script specified by url. The extension on the filename determines the file format: .jpg, .pdf, .gif, .bmp, .tif. The number of each image is added to the filename and field: For example, if you specify filename="page.jpg" and field="file", the images are uploaded as "page1.jpg", "page2.jpg", etc., with field names "file1", "file2", etc.
This method simulates the action of a user submitting a form whose ACTION=url and METHOD="POST", containing one file-upload field for each image in the control. EZTwainX 1.49 adds support for secure uploads using SSL/HTTPS. See Uploading.
1.47
1.49
ViewLogFile Display the EZTwainX logfile using Notepad. 1.46b3


 Privacy Policy Copyright © 2002-2008 by Dosadi. All rights reserved.