GRAPHICS command misbehaving

BlitzMax Forums/BlitzMax Beginners Area/GRAPHICS command misbehaving

hello all :

consider this code:
Strict

Graphics 640,480,32

Local bobimage:Timage=LoadImage("light.png")
Local logo:Timage=LoadImage("b-max.png")


While Not KeyDown(Key_Escape)
Cls
DrawImage logo,10,10
DrawImage bobimage,MouseX(),MouseY()
Flip
Wend

(using the graphics form the samples dir, this works fine , both images draw ok with masking working fine

now try :

Strict

Local bobimage:Timage=LoadImage("light.png")
Local logo:Timage=LoadImage("b-max.png")


Graphics 640,480,32


While Not KeyDown(Key_Escape)
Cls
DrawImage logo,10,10
DrawImage bobimage,MouseX(),MouseY()
Flip
Wend

and the masking falls to bits all images have a black square border round them, and no matter what combination of blends and load image peramiters i try it still fails to draw the black areas as transparent, am i missing somthing os is the postion of the graphics statement in code that important to the way images are drawn

any help mot greatfuly receved

Rgards Ian

It's usually best to use the Graphics command before doing anything with graphics, including loading images. I believe that after the images are loaded, you can call graphics again, to change resolution or refresh rate or simular, without the need to reload the images.

Calling Graphics after loading images never used to work very well in B3D. Perhaps the same is true here?

I would hazard a guess that the TImage's get corrupted or invalidated during a Graphics call.

thaks for that, i was not aware you could recall the graphics command more than one

regards