Article View: comp.lang.pascal.delphi.misc
Article #306Out Of Resources. Any idea why?
From: Boefje
Date: Mon, 10 Dec 2001 18:02
Date: Mon, 10 Dec 2001 18:02
31 lines
2060 bytes
2060 bytes
I use the next code to display a score. The score is a bitmap,
returned by function ScoreBitmap. The bitmap is a standard true color
(24-bits) bitmap.
;------------------------------------------------------------
procedure TForm1.DisplayScore(ai_Team ,ai_Score : integer);
var TmpBmp : TBitmap;
begin
TmpBmp := TBitmap.Create;
TmpBmp.Width := ImageScore1.Width;
TmpBmp.Height := ImageScore1.Height;
TmpBmp := ScoreBitmap(ai_Score,TmpBmp.Width,TmpBmp.Height);
ImageScore1.Picture.Bitmap.FreeImage; { usefull?}
ImageScore1.Picture.Bitmap.Dormant; { usefull?}
ImageScore1.Picture.Bitmap.ReleaseHandle; { usefull?}
ImageScore1.Picture.Bitmap := TmpBmp;
TmpBmp.Free;
end;
;------------------------------------------------------------
After displaying the score many times, I get out of resources
(EOutOfResources). This can only be caused by the created bitmaps. But
I do not understand why. Please explain.
I tried to release the handles of the created bitmaps, but that did
not help. Also, can you explain if the dormant method is of any use to
me? It doesn't seem to harm, but does it help?
Boefje
Technical Details
Message-ID:
<287dc9c0.0112101002.6cbc2cb@posting.google.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10baee,74d708b07592566d,start X-Google-Attributes: gid10baee,public X-Google-Thread: 1043cf,74d708b07592566d,start X-Google-Attributes: gid1043cf,public X-Google-ArrivalTime: 2001-12-10 10:02:56 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail From: boefje@hotmail.com (Boefje) Newsgroups: comp.lang.pascal.delphi.misc,borland.public.delphi.objectpascal Subject: Out Of Resources. Any idea why? Date: 10 Dec 2001 10:02:56 -0800 Organization: http://groups.google.com/ Lines: 31 Message-ID: <287dc9c0.0112101002.6cbc2cb@posting.google.com> NNTP-Posting-Host: 62.251.20.93 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1008007376 30542 127.0.0.1 (10 Dec 2001 18:02:56 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 10 Dec 2001 18:02:56 GMT