Trying to load a masked image

BlitzMax Forums/BlitzMax Beginners Area/Trying to load a masked image

bstripp(Posted 2005) [#1]
Couple more questions. I see that PNG's are supported now. Does this mean they keep their Alpha channel information?

Secondly, if I am loading a BMP or JPG which I have a mask color, how do I load it with that mask color. This is what I am trying:

setmaskcolor(255,0,255)
n.img% = LoadImage(tempimage$,flags=MASKEDIMAGE)

It's giving me a flag error. Do I not have to set the flags for the loadimage?


Scott Shaver(Posted 2005) [#2]
try

setmaskcolor(255,0,255)
n.img% = LoadImage(tempimage$,MASKEDIMAGE)


Perturbatio(Posted 2005) [#3]
Couple more questions. I see that PNG's are supported now. Does this mean they keep their Alpha channel information?

Yes.


JazzieB(Posted 2005) [#4]
PNG's do keep their alpha, as long as you saved them with their alpha channel information (as not all packages do by default), but to make use of it you need to set the blend mode to alphablend before drawing them (SetBlend ALPHABLEND).