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
 TImageEnMView multi scan and save to database

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
Flashcqxg Posted - Jan 15 2021 : 21:14:28
Hi:
I want to use TImageEnMView to scan multiple pages and store them in the data,and my code:

DBBitmap: TIEDBBitmap;
DBMultiBitmap: TIEDBMultiBitmap;

form create:
  DBMultiBitmap := TIEDBMultiBitmap.Create(dsImages, 'Image', 'FileName');
  DBMultiBitmap.Mode := dmAllRecords;
  ImageEnMView.SetExternalMBitmap(DBMultiBitmap);
  DBMultiBitmap.FollowDBCursor := True;

  DBBitmap := TIEDBBitmap.Create(dsImages, 'Image', 'FileName');
  imageenview.SetExternalBitmap(DBBitmap);


procedure TFrmScan.ImageEnMViewAcquireBitmap(Sender: TObject;
  ABitmap: TIEBitmap; DpiX, DpiY: Integer; var Handled: Boolean);
begin
  ABitmap.Rotate(180);
  DBMultiBitmap.AppendImage(ABitmap);
end;

After the scan, there are a lot of blank data stored in the database.
9   L A T E S T    R E P L I E S    (Newest First)
Flashcqxg Posted - Jan 16 2021 : 19:22:24
Now i use the TBlobField method to add directly to the database.
Flashcqxg Posted - Jan 16 2021 : 19:19:50
Hi,i have test the code,it works well.
xequte Posted - Jan 16 2021 : 18:15:40
Hmmm, I can't see any good reason for this occurrence.

Does the following code also do a double append?

ABitmap := TBitmap.create;
ABitmap.Read( 'C:\image.jpg' );
DBMultiBitmap.AppendImage(ABitmap);
ABitmap.Free;


How about if you use non-ImageEn methods for appending?

Nigel
Xequte Software
www.imageen.com
Flashcqxg Posted - Jan 15 2021 : 22:41:58
Logger.Info(DBMultiBitmap.AppendImage(ABitmap).ToString);
The log:

[2021-01-16 11:40:07] INFO 0
[2021-01-16 11:40:15] INFO 2
[2021-01-16 11:40:21] INFO 4
[2021-01-16 11:40:27] INFO 6
Flashcqxg Posted - Jan 15 2021 : 22:36:29
I scanned 2 pages of paper with 4 pictures on both sides. There are 4 correct picture rows in the database and 4 blank rows.
Flashcqxg Posted - Jan 15 2021 : 22:33:38
I use the firedac+sqlite,use the default attributes of fdquery.
xequte Posted - Jan 15 2021 : 22:31:01
So, it sounds like the image is not being written correctly to the database. Does it need to be manually flushed? What database engine do you use?



Nigel
Xequte Software
www.imageen.com
Flashcqxg Posted - Jan 15 2021 : 22:05:19
Hi
I use double-sided scanning. When scanning, TImageEnMView will first display two identical pictures (but in fact the front and back contents are different), but a blank picture will be displayed later. In the final data, there are correct data, but there will also be the same number of blank data rows.
xequte Posted - Jan 15 2021 : 21:55:50
Hi

Is the content of ABitmap valid prior to the append?

When do you see the blank content? Immediately in the TImageEnMView after the scan? Or only in the database content itself?


Nigel
Xequte Software
www.imageen.com