Monkey runtime error: setting image handle

Monkey Targets Forums/XNA/Monkey runtime error: setting image handle

dave.h(Posted 2012) [#1]
Hi guys does anyone have any idea why i get a runtime error in xna with the code below but not in android,html5 or glfw.

wormhole=LoadImage("wormhole.png")
wormhole.SetHandle(wormhole.Width/2,wormhole.Height/2)

ive tried loading it in OnCreate and in OnUpdate but it just crashes the program.Ive narrowed it down to the line

wormhole.SetHandle(wormhole.Width/2,wormhole.Height/2)

i cant set the handle of any image in xna.
The image does actually exist as well as ive checked.In fact the game runs perfect in android.

is there another way to set the handle


slenkar(Posted 2012) [#2]
check to see what the width and height values are


NoOdle(Posted 2012) [#3]
You could try:

 wormhole = LoadImage( "wormhole.png", 1, Image.MidHandle ) 



dave.h(Posted 2012) [#4]
thanks guys

@ slenkar after i checked the values and they were exactly what they should have been i found the error.I had a drawimage command under the sethandle command in my Onupdate and i believe thats a big no no.Funny but it works in android,that must be more forgiving.

@ noodle yes that options looks a lot better.I didnt even know i could do that.

another nooby mistake by me but a mistake is just another word for experience,we live and learn.