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
 Low memory problem
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

quantuz

Sweden
55 Posts

Posted - Jan 25 2014 :  19:35:19  Show Profile  Reply
Hi!

I have a low memory problem wich maked IE stop updating the display bitmap when I try to show more bitmaps in my single ImageEnView.
I have an array of many TIEBitmap object wich I show on my view with SetExternalBitmap(), the display freez with the same image displayed even if I try to show another with SetExternalBitmap().
Then if I delete one of my TIEBitmap object in my list the display start working again. A new TIEBitmap object is allocated and displayed until I get the freez, the is no hang or exception the display just dont update.

ImageEnView1->SetExternalBitmap(myTIEBitmap);

Is this a known behaviour of IE? And how can I know when IE is in troble, so I can free up some memory?

Regards,
//Christer Strandh

w2m

USA
1990 Posts

Posted - Jan 26 2014 :  08:14:21  Show Profile  Reply
It has been my experience that you should only call SetExternalBitmap one time. The best way to show different bitmaps is to assign them from your array or use TIEImageList defined in hyieutils.pas to hold your images. Also you can usually eliminate memory problems by compiling as Win64. My EBook has some examples on how to use TIEImageList.

I have one question for you though. How many images are in your array and what are the dimensions of the images?

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html

Go to Top of Page

spetric

Croatia
308 Posts

Posted - Jan 27 2014 :  06:32:47  Show Profile  Reply
I had similar problems (version 3.0.2) and the solution was simple:
Before changing external bitmap set PaintView iebitmap to zero:
PaintView->SetExternalBitmap(0);
PaintView->SetExternalBitmap(someIEBitmap):
Go to Top of Page

quantuz

Sweden
55 Posts

Posted - Jan 28 2014 :  15:50:01  Show Profile  Reply
Hi!
Thansk fo the tip, I had already in some places set SetExternalBitmap(NULL); but not all places, added SetExternalBitmap(0) to all places I used it but the same problem.
I have my IEBitmap's atttached to my own class object and when I want to show it I use SetExternalBitmap. I could try to assign(copy) them to a single display IEBitmap, but I want to avoid any copying, I asume SetExternalBitmap() dont make any copy?

//Christer



Go to Top of Page

spetric

Croatia
308 Posts

Posted - Jan 28 2014 :  16:05:46  Show Profile  Reply
Well, I don't have any problems with that. Beside setting externalbitmap to 0, I often call Blank function. Currently, I'm using external bitmaps in ImageEnView for showing image contour. When my object (TImageContainer), that holds images and masks changes (due to switching images), I set new external bitmap:

//---------------------------------------------------------------------------
void __fastcall TFormContour::UpdateContour(TImageContainer *imageContainer)
{
ievContour->SetExternalBitmap(0);
ievContour->Blank();
if (imageContainer)
{
if (imageContainer->ImageContour)
ievContour->SetExternalBitmap(imageContainer->ImageContour->ieBitmap);
}
}

Maybe you should call Blank() method prior to setting new external bitmap. SetExternalBitmap does not make copy of original image...as far, as I know.
Go to Top of Page

quantuz

Sweden
55 Posts

Posted - Feb 09 2014 :  16:31:49  Show Profile  Reply
Hi!
I tried the ievContour->Blank(); call but the problem remains.
I could free up memory if I just find a way to detect that IE is out of resources, is there a way to detect that?
//Christer
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: