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
 Do Changes in the TIEAcquireBitmapEvent.
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Ralf

112 Posts

Posted - Jan 18 2017 :  02:41:53  Show Profile  Reply
Hallo,

I want to do some Changes after Scanning a new Image in the TIEAcquireBitmapEvent.

TIEAcquireBitmapEvent = procedure(Sender: TObject; ABitmap: TIEBitmap; DpiX, DpiY: Integer; var Handled: boolean) of object;

Checking if the page is empty is no problem. If the page is empty I can set handling to true and the new Image isn't insert.

What I also want to do in the TIEAcquireBitmapEvent is to Rotate the Image if one of the following is true:
- the Image was not scanned exactly Proc.SkewDetection(300, 15, 0.1, true);
- or the user want to rotate for example the scanned Page is Landscape and the scanner can not do the rotation on it's own.

here a not complete source

  proc := TImageEnProc.Create(nil);
  try
    proc.AttachedIEBitmap:=ABitmap;

    domValue:=Proc.GetDominantColor(domColor)/100;

    if 1 - domValue <= 0.005 then
    begin
      Handled:=true;
      exit;
    end;

    Rot := Proc.SkewDetection(300, 15, 0.1, true);
    if not <Scanner kann Rotate> then
    begin
      If Rotatelevel<>0 then Rot:=Rot+(Rotatelevel*90);
    end;

    If Rot<>0 then
    begin
      Proc.RotateandCrop(Rot);
    end;
...

What I want, is that this changes (Rotation) are made and the insert Image have the changes. Is it in any way possible to do that? Or must be the ABitmap: TIEBitmap in the Event changed to var from Nigel?

Thanks

Ralf

xequte

38176 Posts

Posted - Jan 19 2017 :  18:48:04  Show Profile  Reply
Hi Ralf

Why not just process the image after the call to Acquire()?


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

Ralf

112 Posts

Posted - Jan 20 2017 :  03:11:03  Show Profile  Reply
Hi Nigel,

i also found this option to do this change in the AfterAcquireBitmap. But when i can do this changes in the TIEAcquireBitmapEvent i can save time.

At the Moment i create twice a TImageEnProc to do the following changes:

1. the recognice of white Papers in the TIEAcquireBitmapEvent
2. the rotation in the AfterAcquireBitmap

Best Regards

Ralf
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: