Thread View: comp.lang.pascal.delphi.misc
1 messages
1 total messages
Started by Boefje
Wed, 05 Dec 2001 12:23
Out of resources
Author: 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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads