ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 HOW to save multiple images on the attached exampl
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

ImageEnSA

14 Posts

Posted - Aug 28 2019 :  20:26:27  Show Profile  Reply


Hi everyone,

I have a simple problem and I need your help

as in the attachment, I tried to save all scanned pictures as png images. However, when I scan many papers, it only saves one image!!

Please some help

Thanks

attach/ImageEnSA/201982820245_myTwain.zip
2784.67 KB

xequte

38616 Posts

Posted - Aug 29 2019 :  17:04:03  Show Profile  Reply
Hi

A TImageEnView only holds a single image, so to acquire and save multiple images, either:

1. Save images as they are acquired using the OnAcquireBitmap event:

https://www.imageen.com/help/TImageEnView.OnAcquireBitmap.html


// Scan multiple images with a TImageEnView
procedure TForm1.ImageEnView1AcquireBitmap(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);
end;


2. Use a TImageEnMView which can hold multiple images, then save each image in turn

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

ImageEnSA

14 Posts

Posted - Aug 29 2019 :  20:13:26  Show Profile  Reply
I tried to use your code



// Scan multiple images with a TImageEnView
procedure TForm1.ImageEnView1AcquireBitmap(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);
end;



But it only saves ONE PAGE!!


May you please give me a complete example?
Go to Top of Page

xequte

38616 Posts

Posted - Aug 29 2019 :  23:08:55  Show Profile  Reply
Sorry, I misread your requirements. You are looking to scan a multi-page document and save all pages to a separate file (not looking to scan documents individually and have them automatically saved to file).

TImageEnView cannot scan multiple pages at a time.

You need to use TImageEnMView for that.

Please open the demo:

\Demos\ImageAcquisition\AllAcquire\AllAcquire.dpr

And add this code to the OnAcquireBitmap event:


procedure TfrmMain.ImageEnMView1AcquireBitmap(Sender: TObject; ABitmap:
    TIEBitmap; DpiX, DpiY: Integer; var Handled: Boolean);
var
  filename : string;
begin
  filename := FormatDateTime( 'C:\Scanned Documents\Scan_yymmdd-hhnnss-zzz.jpg', Now );
  ABitmap.Write( filename);
  Handled := False; // Set to true if you don't want image added to ImageEnMView1
end;


Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: