Drawimage not working
Posted: Mon Mar 20, 2006 3:12 pm
Hi everyone, just starting out in purebasic after using blitz based products for the past few years. PureBasic seems very powerfull and intuitive. I was just trying out some simple things to get to grips with the syntax, structure etc. I've hit a small problem which I'm certain is something small and easy to fix to anyone who knows how to code in PB. Anyway this is the code:
The above code does display the text but not the image. I've tried loading an image and displaying it but that doesn't work either. Any ideas?
Thanks
Code: Select all
img = CreateImage(#PB_Any, 100, 100)
StartDrawing(ImageOutput())
Box(10, 10, 80, 80, RGB(Random(255),Random(255),Random(255)))
StopDrawing()
If InitSprite() And InitKeyboard() And OpenScreen(800,600,16,"")
Repeat
FlipBuffers()
If StartDrawing(ScreenOutput())
DrawText("hello!")
DrawImage(img, 10, 10)
StopDrawing()
EndIf
ExamineKeyboard()
If KeyboardPushed(#PB_Key_Escape) ; press Esc to quit
End
EndIf
ForEver
EndIf
Thanks