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