DrawImage and transparency

Blitz3D Forums/Blitz3D Beginners Area/DrawImage and transparency

jreyes(Posted 2005) [#1]
Hi all,

I am trying to display with transparency a TGA image that has R,G,B and alpha channel. The Blitz manual says that DrawBlock paints without taking into account transparency or MaskImage but that Drawimage does take them into account. I am using the latter but all image gets displayed regardless of the information present in the transparency channel. I dont have problems texturing the image on a 3D surface. In that case transparency is fine. But, what I need is 2D painting with transparency. My code:

-----------------------
Graphics 1280,1024,32,1

im=LoadImage("temp.tga")
While not keyhit(1)
DrawImage im,0,0
Wend
-----------------------

Thanks for your help


cermit(Posted 2005) [#2]
You'll have to write your own alpha/transparency function or use you can use this one:
http://www.blitzbasic.com/codearcs/codearcs.php?code=27

Hope it helps.


Ross C(Posted 2005) [#3]
Yeah, blitz will only mask pixels. As cermit says, you'll have to do it manually


jreyes(Posted 2005) [#4]
Understood. Thanks very much. I'll work on the drawalphaimage code...

Jreyes