Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
T O P I C R E V I E W
DelphiLover
Posted - Mar 30 2018 : 19:58:50 Hello, I use ImageEnMView and ImageEnDBView I want to save every single image to new database record when loading mutiple images I tried OnImageLoaded and OnImageAdded events but it didn't work Is there any way to do this without have to wait loading all images finished and loop thru them? Thank you
3 L A T E S T R E P L I E S (Newest First)
xequte
Posted - Apr 02 2018 : 01:30:15 OK, I'm not fully following your method. Whether you resize them before saving to the database, should not matter.
Some thoughts:
- Don't use ImageEnDBView, it is outdated. Use TIEDBBitmap (e.g. connected to a TImageEnView) or TIEDBMultiBitmap (connected to a TImageEnMView). - ImageEnMView will load images on demand if you use an OnDemand method, such as: https://www.imageen.com/help/TImageEnMView.LoadFromFileOnDemand.html - OnImageAdded does not apply when loading. OnImageLoaded is called as each image is loaded - If a TImageEnMView is loading images on demand, you can force loading of an image by accessing, e.g. using GetTIEBitmap.
Posted - Mar 31 2018 : 06:12:24 Hi, Thank you for your answer.
I thought about this, but it will take more time especially i'm resizing all images to 200KB before save them to database so it will be 3 stages
1- Adding images from Scanner or Multiple files 2- Iterate thru images to resize them 3- Iterate thru images to save them to database
also if user update an image I will have to Iterate thru all images again to resize and save to database
It will be much easier, and cleaner way if we can Resize and save to database every single image immediately when it is added to ImageEnMView so we don't have to Iterate thru images at all
xequte
Posted - Mar 30 2018 : 20:47:52 Hi
Rather than using an ImageEnMView, which will try to load all images, why not use a TIEBitmap (or TImageEnView). Iterate through the frames in turn (by settings:
cnt := IEGetFileFramesCount(...);
for idx := 0 to cnt - 1 do
begin
BMP.ParamsEnabled := True;
BMP.Params.Index := idx;
BMP.Read(...);
Assign to DB...
end;