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
 Out of memory TImageENMView.SetImage
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

and1989

Russia
4 Posts

Posted - Apr 04 2017 :  06:13:05  Show Profile  Reply
I use TImageENMView with images. When in the list of images less than 300 everything works fine. But if you load 4000 images into the list, the error "out of memory" occurs.
To solve this problem, we dynamically loaded images into the list. If the downloaded images will be more than 250, then we erase the entire list and load those on which the user is focused. This decision helped, but not for all cases. Sometimes, even with the number of images less than 250, an error occurs "out of memory".

On this line "out of memory".
FImageMView.SetImage (fCurrentIndex, fCurrentBitMap);

P.S.: how can I free memory from the ministlist for specific images by index?

Best regards,
Andrei Velganenko

w2m

USA
1990 Posts

Posted - Apr 04 2017 :  10:05:39  Show Profile  Reply
You can minimize memory requirements by using thumbnails rather than using the original normal image. You can display many more images as thumbnails than you can by loading the full image. This will reduce memory problems. You can then load the full normal image into ImageEnView when a image is selected in ImageEnMView by getting the file name from ImageEnMView and then use ImageEnView.LoadFromFile to display the full image.

There are numerous posts about this that you can search for.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

and1989

Russia
4 Posts

Posted - Apr 04 2017 :  11:09:02  Show Profile  Reply
We use in our project thumbnails in a mini-sheet. I would like to know the maximum memory size, which you can use when working with the TImageENMView component. And how is it formed? Based on what? The resources of the computer are more than enough.

If there is an association from memory, then this error will in any case be repeated on a larger scale, even if the images are compressed.
Go to Top of Page

xequte

38610 Posts

Posted - Apr 04 2017 :  16:25:40  Show Profile  Reply
Hi

Essentially they are stored as uncompressed images in memory, so you really shouln't have a huge number loaded at a time.

Either store them as thumbnails (StoreType = ietThumb) and load the full sized image as required.

Or load the images on demand, e.g. by setting ImageFileName.

https://www.imageen.com/help/TImageEnMView.ImageFileName.html

Then the MaintainInvisibleImages property will clean up any images that are no longer onscreen.

https://www.imageen.com/help/TImageEnMView.MaintainInvisibleImages.html

You can use EnsureImageLoaded if you need to operate on a particular image:

https://www.imageen.com/help/TImageEnMView.EnsureImageLoaded.html

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

and1989

Russia
4 Posts

Posted - Apr 07 2017 :  04:16:58  Show Profile  Reply
Many thanks for your answers. You pointed me in the right direction. I tested my system on 4000 pictures. Everything works perfectly!

Perhaps someone will come in handy.
I used this approach:

ImageEnView1.MaintainInvisibleImages := 0;
ImageEnView1.StoreType := ietThumb;
ImageEnView1.ImageFileName[0] := path1;
...
ImageEnView1.ImageFileName[N] := pathN;

To force a picture update, I used:

TImageEnMView.ReloadImage(idx);

Thanks again!


Go to Top of Page

xequte

38610 Posts

Posted - Apr 07 2017 :  18:35:41  Show Profile  Reply
Hi

EnsureImageLoaded() should give better performance than ReloadImage() as it only loads the image if needed. Did you have problems with it?

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

and1989

Russia
4 Posts

Posted - Apr 10 2017 :  02:25:14  Show Profile  Reply
In our version of imageen, the TImageENMView does not have method EnsureImageLoaded(). Most likely we do not use the latest version. For our task, we need to read the image from the disk again, because It changes from the program. I will explain. The mini-list displays files from the repository. We select the image. It appears in the area of working with the image. Then we cut off, change the color,... After these operations, we save the result. After that we need to update the picture in the mini-list. We do this using ReloadImage().
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: