Autor Beitrag
Andreas Pfau
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 997



BeitragVerfasst: Sa 19.04.03 14:34 
Hallo,

wie muss ich eigentlich Bitmaps freigeben? Ich mache das immer mit TBitmap.Free(). Aber wozu all diese Methoden (Dormant(), FreeImage(), ReleaseHandle())? Muss ich die auch aufrufen, um den Speicher restlos freizugeben?

_________________
Life is a bad adventure, but the graphic is really good!
Simon Joker
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 236
Erhaltene Danke: 1



BeitragVerfasst: Do 24.04.03 10:31 
Hi

Free ist die beste Lösung wenn das Objekt zur Laufzeit erstellt wurde und keinen Besitzer hat. Free ruft Destroy auf wenn das Objekt <> Nil ist sonst gibst ja Fehler.
FreeImage gibt die gecacheten Bilddaten frei. Diese werden bei internen Umwandlungen erzeugt, z.B. Farbtiefenänderung usw.
Mit ReleaseHandle wird das Bitmap vom zugehörigen Handle getrennt. Verwenden Sie diese Methode, um ein Bitmap-Handle an eine Routine oder ein Objekt zu übergeben, das Eigentümer des Bitmap-Handles wird oder es freigibt.

Wenn es keinen Eigentümer gibt, dann immer Free, da so alle anderen nötigen Freigaben aufgerufen werden.
Andreas Pfau Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 997



BeitragVerfasst: Do 24.04.03 16:22 
Gut, Danke! Dann langt Free() also.

PS: Darfst ruhig DU sagen (hoppla... mach's ja selber *unhöflich bin*)

_________________
Life is a bad adventure, but the graphic is really good!
Simon Joker
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 236
Erhaltene Danke: 1



BeitragVerfasst: Do 24.04.03 18:05 
Tja, war reiner Reflex, aus dem kommerziellen Schriftverkehr. Die Arbeit bekommt dich halt, woimmer du bist, wasimmer du tust.