BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How do I get Windows to free the memory after creating and f

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
ma
Guest





PostPosted: Tue Jun 08, 2004 9:33 pm    Post subject: How do I get Windows to free the memory after creating and f Reply with quote



I have a small program that loads images automatically from a directory,
resizes them and saves them to another file
Although I free the bitmap and set its size to zero it is still taking up
vast amounts of memory in windows.
It is only when the program is closed down that the memory is free.

Any help would be appreciated
thanks

try
tbmp:=frmimage.LoadImage(
edtdir.text+''+li.subitems[0]);
nw:=strtoint(trim(newwidth.text));
nh:=strtoint(trim(newheight.text));
try
if chkaspect.Checked then begin

MainPImage:=frmImage.ResizeImage(tbmp,nw,0,true);
end else begin

MainPImage:=frmImage.ResizeImage(tbmp,nw,nh,false);
end; {if height & width chosen}
MainPImage.Dormant;
tbmp.Dormant;
finally
tbmp.Width:=0;
tbmp.Height:=0;
tbmp.FreeImage;
application.ProcessMessages;
tbmp.Free;
end; {try finally}
application.ProcessMessages;
finally
MainPImage.Width:=0;
MainPImage.Height:=0;
MainPImage.FreeImage;
MainPImage.Free;
application.ProcessMessages;
end; {try finally}


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.