Article View: comp.lang.pascal.delphi.misc
Article #307Out of resources
From: Boefje
Date: Wed, 05 Dec 2001 12:23
Date: Wed, 05 Dec 2001 12:23
31 lines
2042 bytes
2042 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.0112050423.6b01f6e8@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: 1043cf,a786e378417f58d0,start X-Google-Attributes: gid1043cf,public X-Google-Thread: 10baee,a786e378417f58d0,start X-Google-Attributes: gid10baee,public X-Google-ArrivalTime: 2001-12-05 04:23:21 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 Date: 5 Dec 2001 04:23:21 -0800 Organization: http://groups.google.com/ Lines: 31 Message-ID: <287dc9c0.0112050423.6b01f6e8@posting.google.com> NNTP-Posting-Host: 134.146.0.27 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1007555001 3910 127.0.0.1 (5 Dec 2001 12:23:21 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 5 Dec 2001 12:23:21 GMT