Author |
Topic |
|
richardc
United Kingdom
12 Posts |
Posted - Jul 18 2011 : 13:03:09
|
Hello,
I'm current using the older version of ImageEn, and I'm trying to load a large set of bitmaps holding them in a TObjectList.
My code looks like this:
IEBitmap := TIEBitmap.Create; ImageEnIO := TImageEnIO.CreateFromBitmap(IEBitmap); ImageEnIO.NativePixelFormat := FNativePixelFormat; ImageEnIO.LoadFromFile(CurrentFile); ImageEnIO.Free; Slices.Add(IEBitmap);
Prior to this I use the CalcRawSize method and check the available memory in Windows to make sure I can open them without running out of memory.
The particular set of images I'm trying to open are 899MB in size, and I have 2048MB of available memory, however it runs out of memory before completing the load. This suggests that each image is taking slightly more than twice as much memory as suggested by CalcRawSize (or if I calculate the bitmap size myself).
I've tried changing the code to store the image in an two dimensional array held in an object instead, and once I've copied the data from the IEBitmap I destroy it. In this case it uses pretty much precisely the expected memory usage and all the images load successfully.
The PixelFormat for each image happens to be 1e8g, I'm guessing that it is some how allocating more memory that the 1 byte per pixel that the format requires.
Anyone have any suggestions?
Thanks,
Richard |
|
fab
1310 Posts |
Posted - Jul 18 2011 : 13:29:01
|
Hello, I have some questions: 1) which operating system are you using? 2) how many physical memory has the system? 3) is it possible to get a sample image? |
|
|
richardc
United Kingdom
12 Posts |
Posted - Jul 19 2011 : 00:05:08
|
Hello Fabrizio,
It is Windows XP 32 bit, 4GB of memory and of course only 3.6GB is available.
I can send a sample image, they are all identical in terms of format and size. Where should I send it to as I can't seem to attach it to this forum post.
Thanks,
Richard |
|
|
fab
1310 Posts |
Posted - Jul 19 2011 : 00:18:02
|
>It is Windows XP 32 bit, 4GB of memory and of course only 3.6GB is available.
Just a comment. A process under XP can have up to 2GB (unless you set {$SetPEFlags $0020} and set a flag in boot.ini). In addition you will never have 2GB free for your application (think to mapped dll and their data), and finally it is also difficult to have large continuos free blocks of data (think to the memory fragmentation).
Please send the file to the support email. |
|
|
|
Topic |
|
|
|