ImageEn, unit iemview

TImageEnMView.OnAcquireBitmap

TImageEnMView.OnAcquireBitmap


Declaration

property OnAcquireBitmap: TIEAcquireBitmapEvent;


Description

Occurs whenever a new bitmap is acquired during a multi-page Twain acquisition.
Parameter Description
Sender Will be either a TImageEnIO or TImageEnMIO control
ABitmap A TIEBitmap object that contains the acquired image
DpiX, DpiY The DPI of the acquired image
Handled Setting Handled to True causes ImageEn to ignore this image (i.e. the current image won't be inserted into the TImageEnMView control, if attached). Handled has no effect when acquiring via a TImageEnView/TImageEnIO

Note: Handled defaults to False.


Examples

// Skip retrieval of images that are less than 500x500 pixels
procedure TForm1.ImageEnMView1AcquireBitmap(Sender: TObject; ABitmap: TIEBitmap; DpiX, DpiY: Integer; var Handled: boolean);
begin
  if ( ABitmap.Width < 500 ) or ( ABitmap.Height < 500 ) then
    Handled := True;
end;

// Save scanned images directly to file without adding them to a TImageEnMView
procedure TForm1.ImageEnMView1AcquireBitmap(Sender: TObject; ABitmap: TIEBitmap; DpiX, DpiY: Integer; var Handled: Boolean);
var
  filename: string;
begin
  filename := 'C:\Scanned Documents\Scan_' + FormatDateTime( 'yymmdd-hhnnss-zzz', Now ) + '.jpg';
  ABitmap.Write( filename);
  Handled := True;
end;