Images not displaying

BlitzPlus Forums/BlitzPlus Beginners Area/Images not displaying

Patch(Posted 2005) [#1]
Hey,

I ran my code from the ide and all the images show up correctly and the game runs as it should. When i create an executable the images don't load its just black spaces.

Any ideas with whats wrong?

Thanks


WolRon(Posted 2005) [#2]
Any ideas with whats wrong?
You aren't loading the images?

You know, you really could have supplied a lot more info.
-Is this a Graphics app or Windows app?
-Where are you placing the executable created? Is it located in the same place as your source .bb file?
-Are you referencing the images directly or indirectly? What I mean by that is using the images full path or the path in relation to the executable.
-Are you verifying that your images are being loaded?
If image1 = 0 Then RunTimeError("image1 did not load!")



Grey Alien(Posted 2005) [#3]
Wolron's kinda said it all.


CS_TBL(Posted 2005) [#4]
hm... I figure that if he creates an exe, runs it from another place on his harddisk, and thus can't find his images.. well, I figure that his app should crash when he performs any DrawImage/DrawBlock command, not draw 'black' instead..

Only alternative to this would be the creation of a temp-image when a loadable image can't be found.. like:

img=LoadImage(bla)
If Not img img=CreateImage(64,64)

This way things should at least never crash :P


WolRon(Posted 2005) [#5]
Well, like I said, he should have supplied more info.


Patch(Posted 2005) [#6]
I didn't explain this very well sorry.

When i run the code in debug enabled mode, the images show correctly. When i turn debug enabled off, or create an executable the images no longer show.


CS_TBL(Posted 2005) [#7]
doesn't tell me anything useful..

Show us your image-loading-routine and image-draw-routine..


Patch(Posted 2005) [#8]
Global SomeImage = LoadImage("image.bmp")
DrawImage SomeImage,0,0

This is what im doing to load images and display them.


CS_TBL(Posted 2005) [#9]
hm. weird..

and it you put 'Notify SomeImage' right after loading the image.. what values do you get in debugmode, and releasemode?


CS_TBL(Posted 2005) [#10]
more ways to debug..

put:

Notify Imagewidth(SomeImage)


Right before you're going to draw it.. (and test it @ releasemode!)

Somehow you need to make sure you do have an image in memory..


CS_TBL(Posted 2005) [#11]
oh w8 !

now that I think about it.. do you *ever* access the image with Setbuffer Imagebuffer(SomeImage) ?

Perhaps you *think* you are back at a canvasbuffer or backbuffer and perform a CLS while in reality you're still focusing at that imagebuffer.. dunno why this could cause problems between debug- and releasemode.. but.. gotta check it all eh.. ^_^


Grey Alien(Posted 2005) [#12]
When using Graphics (command) debug is in windowed mode whereas release mode is normally full screen unless you specifiy windowed mode with a flag.