loading/drawing images

BlitzPlus Forums/BlitzPlus Beginners Area/loading/drawing images

Lingard(Posted 2008) [#1]
I'm running Blitzplus on a vista computer. Whenever I try to load an image and then draw it, when I try to run the program it brings up an error saying 'Invalid Image handle' and it won't compile.

A sample of what Im writing follows:

graphics 640,480

shipimage = loadimage("ship.bmp")

drawimage shipimage,320,240

flip

waitkey

Any idea what is wrong here or what could fix it? Thanks.


Snarkbait(Posted 2008) [#2]
is the program in the same directory as the image? Test if shipimage > 0


Lingard(Posted 2008) [#3]
The directory seemed to be the problem. Once I saved the code into the same folder as the images, then tried it, it worked. Thanks for your help!


Your Friendly Neighborhood Geek(Posted 2008) [#4]
total Newbie. Like Me!!!


Galdon(Posted 2008) [#5]
I'm having a very similar problem. I've been trying to do tutorials but every demo program I run compiles fine, then when I run it I get the Invalid Image handle error and it closes. (the files are already all in the same folder)


Sauer(Posted 2008) [#6]
I've had issues before with this because I didn't actually manually save the .bb file. If you're running your program and the tab says <untitled> most of the time it won't work, and you just have to go file, save as, etc.

Also try making the image handle a global variable, like:
Global imagename=loadimage("image.bmp").

Some computers do this, others don't, and this may not even be your problem, but thats all I can come up with.