Image..Transparency

BlitzPlus Forums/BlitzPlus Beginners Area/Image..Transparency

Apollonius(Posted 2006) [#1]
Is there any way to make an image for example 50% transparent? There doesn't seem to be any built in fonctions.. as far as DLLs goes I don't know how to use them... if there no.. transparency.. then this tool's not made to make games.. :o


Matty(Posted 2006) [#2]
In Blitzplus you have to do it 'manually' by writing pixels directly to either the backbuffer or an imagebuffer and calculating the color of the pixels drawn using the color of the pixel 'beneath'. Writepixelfast commands are fine, readpixelfast commands are slow. Using a bank to store the background in is faster. Faster still, if you know that the background image has a lot of sections that are one color, or have sections where the color variation is minor you can do the readpixel/peekbyte function less often by calling it less often which speeds things up.


Junkprogger(Posted 2006) [#3]
Matty : readpixel/>>peekbyte<<?

here some codes from blitzforum.de :
http://www.blitzforum.de/forum/viewtopic.php?t=14366&highlight=transparenz

This user used banks for it...
http://www.blitzforum.de/forum/viewtopic.php?t=6026&highlight=transparenz


My tip : if you don't need realtime transparency, calculate it when the program is starting!


Andres(Posted 2006) [#4]
Create a TGA file with alpha channel and use these functions to load/display it: http://www.blitzbasic.com/codearcs/codearcs.php?code=1814

You can use frames too with it and you can use different alpha value for each pixel.