Image handles in global types don't work?

Blitz3D Forums/Blitz3D Programming/Image handles in global types don't work?

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.

Test this:

Graphics 800,600

Type InterfaceGlobals 
Field interfaceImage% 
End Type 

im=CreateImage(800,600)
SetBuffer ImageBuffer(im)
For x=0 To 40
Color x*2+50,x*2+50,x*2+50
Rect Rand(0,800),Rand(0,600),Rand(10,20),Rand(10,20),1
Next
SetBuffer BackBuffer()

SaveImage(im,"Test.bmp")
FreeImage(im):im=0

;Then in another file I have: 
Global theInterfaceGlobals.InterfaceGlobals 


 loadinterfaceImage("Test.bmp")

 DrawImage(theInterfaceGlobals\interfaceImage,0,0)
 Flip
 WaitKey
 
Function loadinterfaceImage(FileName$) 
theInterfaceGlobals = New interfaceGlobals 
theInterfaceGlobals\interfaceImage = LoadImage(FileName$)  
End Function


Works for me.