Declaration
function Acquire(bResetParams : Boolean = False) : boolean;
Description
Perform a single image acquisition from the
SelectedAcquireSource, which may be a Twain or WIA scanner, connected camera or phone.
SelectedAcquireSource is set when the user chooses a source if you have called
SelectAcquireSource or manually set a source using
SetAcquireSource.
If bResetParams is True then
SetDefaultParams is called before Acquire to reset the
IO parameters (if you have already loaded an image from file).
Result is true if there was a successful acquisition.
Note: For acquisition of multiple images use
TImageEnMIO.Acquire.
| Demos\ImageAcquisition\AllAcquire\AllAcquire.dpr |
// Prompt the user to choose a scanner source and then acquire
if ImageEnView1.IO.SelectAcquireSource([ieaTwain, ieaWIA, ieaDCIM]) then
ImageEnView1.IO.Acquire();
// Capture from the default WIA device
if ImageEnView1.IO.SetAcquireSource(ieaWIA, Default_Device) then
ImageEnView1.IO.Acquire();
// Select the second Twain device and capture
if ImageEnView1.IO.SetAcquireSource(ieaTwain, 1) then
ImageEnView1.IO.Acquire();
// Capture from the Twain device named, CanoScan FB620
if ImageEnView1.IO.SetAcquireSource(ieaTwain, 'CanoScan FB620') then
ImageEnView1.IO.Acquire();
// Retrieve from the camera card listed as H:\ drive
if ImageEnView1.IO.SetAcquireSource(ieaDCIM, 'H') then
ImageEnView1.IO.Acquire();
// Capture without a dialog
ImageEnView1.IO.AcquireParams.VisibleDialog := False;
if ImageEnView1.IO.Acquire then
ImageEnView1.IO.SaveToFile('D:\newimage.jpg'); // save scanned image