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
 Program crashing after scanner dialog (sometimes)
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

wskelton3

USA
11 Posts

Posted - Jan 16 2015 :  17:47:15  Show Profile  Reply
Delphi XE5, ImageEn 5.0.6, Windows 7, TWAIN drivers

My program works with a variety of scanners but lately I've had trouble with one customer using an HP ScanJet 5000. The program acquires the image displaying the scanner dialog; however, when I click Ok to continue, my application crashes. Here's some of the code used to acquire the image.

procedure TfmScanit.RefreshImages;
begin
if (ImageEnMView1.ImageCount>0) then begin
ImageEnView1.ZoomFilter:=rfFastLinear;
ImageEnMView1.CopyToIEBitmap(ImageEnMView1.SelectedImage, ImageEnView1.IEBitmap );
ImageEnView1.Zoom:=((ImageEnView1.width/ImageEnView1.IEBitmap.Width*100)-3);
ImageEnView1.Update;
end else begin
ImageEnView1.Clear;
lblSize.Caption:='Size=0kb';
end;
end;

procedure TfmScanit.pnlScanitClick(Sender: TObject);
begin
pnlScanit.Color:=clRed;
if (tblScans.recordcount=0) or (not dmSC.IsGraphic(tblScansFileExt.AsString)) then begin
tblScans.Insert;
tblScansScanDate.value:=now();
tblScansScanDesc.value:= 'Scanned image';
tblScansFileExt.value:='TIFF';
tblScansSize.value:=FloatToStrF(TBlobField(tblScans.FieldByName('image')).BlobSize/1000,ffNumber,5,0)+'KB';
tblScans.Post
end;
if (ImageEnMView1.MIO.TWainParams.SelectedSource < 0) then
ImageEnMView1.MIO.SelectAcquireSource();
ImageEnMView1.MIO.AcquireClose;
ImageEnMView1.MIO.TWainParams.FreeResources;
ImageEnMView1.SelectSeek(iskLast);
ImageEnMView1.Deselect; // to append images
Need2Save:=ImageEnMView1.MIO.Acquire;
ImageEnMView1.SelectSeek(iskLast);
RefreshImages;
pnlScanit.Color:=clNavy;
end;

It gets to the Need2Save line and bombs.

Anything you can see that I'm not doing or doing that I don't need to do? I know this is difficult to troubleshoot. Just looking for some direction. When I use TWAIN drivers, it crashes. When I use WIA drivers, it works but the scanner dialog is not robust enough.

Thanks for any help.

Bill

xequte

39138 Posts

Posted - Jan 19 2015 :  12:56:18  Show Profile  Reply
Hi Bill

Have you tried updating the firmware on the scanner and updating the drivers?


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