# Command: FreeImage

FreeImage handle Definition:

Removes the designated image from memory.

Parameter Description:

handle=variable that holds the image handle of a previously loaded image

Command Description:

When you are done with an image, use this command to delete the image from memory and free up that memory for other use. Good housekeeping. Get in the habit!

Example:

; FreeImage command
; Global, as always, for graphics
Global gfxPlayer
; Enter graphics mode and start double buffering
Graphics 640,480,16
SetBuffer BackBuffer()
; Load the image-assign the handle to gfxPlayer
gfxPlayer=LoadImage("player.bmp")
; draw the image at random until ESC pressed
While Not KeyHit(1)
Cls
DrawImage gfxPlayer,Rnd(640),Rnd(480)
Flip
Wend
; Erase the image from memory!
FreeImage gfxPlayer

Index