noob help! b2d displaying image.

Blitz3D Forums/Blitz3D Beginners Area/noob help! b2d displaying image.

--==MONKSTER==--(Posted 2003) [#1]
Hey guys,

This code will not display an image.

anyon tell me what I am doing wrong.

;set up small game window
Graphics 320,240,15,2

Global stick = LoadImage("stand.bmp")

ClsColor 255,255,255;set background colour when cls is used to white

Cls;clear screen white

Color 0,0,0;set forground colour

;write text at location
Text 100,100,"Prepare to Fight!"

;draw the stage line
Line 0,200,320,200



WaitKey();wait for a user press

Cls


Line 0,200,320,200

DrawImage stick ,200,160
WaitKey()

FreeImage stick

End;end program


thanks


Grisu(Posted 2003) [#2]
- Not quite sure, "Graphicsmode" must be "16" Bit instead of "15"?

- make shure your bmp does exist

- enable debugmode to track errors.

...your code works here?!?


--==MONKSTER==--(Posted 2003) [#3]
Thanks it's still not working even after changing number to 16.

the stick variable is = 0 when run in debug mode so it might not be loading the image which is bleedy odd it's in the same directory has the bb code.

anymore ideas

Cheers


--==MONKSTER==--(Posted 2003) [#4]
fixed it :)

added MaskImage stick, 255, 0, 255
and that seemed to do the trick.


Grisu(Posted 2003) [#5]
"Maskimage" only sets the transparency color of an image.
In this case (255,0,255) to "pink". - But the code should display the image even without this extra command.

I guess it was more likely a path problem by blitz finding the image...

Anything more I can (try) to help with? :)


--==MONKSTER==--(Posted 2003) [#6]
odd that by adding that line it worked if I remove it it does not work.

the image is black and white also.

thnks


keyboard(Posted 2003) [#7]
Maybe it is working all the time.

If your image is black and white, and your background is white, then you will not see the white part against your background and you will not see the black part because the black is masked by default.

Setting MaskImage to 255,0,255 enables you to see the black part because it is not masked anymore, that's my guess...


--==MONKSTER==--(Posted 2003) [#8]
ah sound thats sounds about right.

Cheers