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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Do Changes in the TIEAcquireBitmapEvent.

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Ralf Posted - Jan 18 2017 : 02:41:53
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
2   L A T E S T    R E P L I E S    (Newest First)
Ralf Posted - Jan 20 2017 : 03:11:03
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
xequte Posted - Jan 19 2017 : 18:48:04
Hi Ralf

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


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com