Graphics command used more than once?

BlitzMax Forums/BlitzMax Programming/Graphics command used more than once?

This code doesn't work although I suspect it should. Anyone want to venture a guess? It will draw the first image just fine, but when I press a key and it tries to reinitialize the graphics window, load the image again and display it - it just draws a white quad.

Is the graphics command not designed to be issued more than once?


Graphics 640,480,0

Local img:TImage = LoadImage( "images/email.png" )
DrawImage( img, 16, 16 )
Flip
WaitKey

Graphics 640,480,0

Local img2 = LoadImage( "images/email.png" )
DrawImage( img2, 64,64 )
Flip
WaitKey