ClearWorld and Images

Blitz3D Forums/Blitz3D Programming/ClearWorld and Images

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I think he means that, when using a screensize of 640x480, using the Graphics command again with the same resolution.
This will unload all pictures, but the handles to them still exist.
When you try to display them afterwards, you'll get an error.

You could use an array if you have lots of images.
Then just loop through them:
Graphics 800, 600, 0, 2

Dim ImageArray(100)

ImageArray(1) = LoadImage("c:\test1.jpg")
ImageArray(2) = LoadImage("c:\Test2.jpg")

DrawImage ImageArray(1), 10, 10
DrawImage ImageArray(2), 200, 200

WaitKey()

For i = 0 To 99
	If ImageArray(i) Then ; Check to see if there was an image loaded or not
		FreeImage ImageArray(i)
	EndIf
Next

DrawImage ImageArray(1), 10, 10 ; Error, image has been freed

WaitKey()