Restored from previous forum. Originally posted by WolfgangS.
HI!
Write ImageGadget(1,0,0,100,100,ImageID())
instead of ImageGadget(1,0,0,100,100,UseImage(1))
UseImage(1) just try to activate an Image with the ID 1 (which even isn't loaded

ImageID() gives you the handle (in PureBasic the "ID") from the Image you need.
Hint: Use WaitWinodwEvent() instead of WindowEvent()
I would write this:
Code: Select all
#ID_MWidnow = 0
#ID_Image1 =10
#ID_IGadget1 =20
hnd_MWindow.l ; handle of the MotherWindow
WEvent.l ; Event's of the MotherWindow
hnd_MWidnow=OpenWindow(#ID_MWidnow,0,0,250,150,#PB_Window_ScreenCentered|#PB_Window_SystemMenu,"Test")
If LoadImage(#ID_Image1,"e:\font2.bmp")=0
beep_(100,1000):End
EndIf
If CreateGadgetList(WindowID())=0
beep_(100,1000):End
Else
ImageGadget(#ID_IGadget1,0,0,100,100,ImageID())
EndIf
Repeat
WEvent=WaitWindowEvent()
Until WEvent=#PB_Event_CloseWindow
MFG
:)WolfgangS