How can I draw text on a TImage and retain Alpha?

BlitzMax Forums/BlitzMax Programming/How can I draw text on a TImage and retain Alpha?

If your display is 32-bit color, and only that mode, your grabbing of the image should copy the alpha channel as well. Otherwise there is no alpha to grab in the destination.

At least in GL you can draw to a 32-bit screen that has an alpha channel, using a 32-bit scroll image with alpha, but as `solidblend` and with alpha channel enabled. Then draw the text the same. Then glcopyTexsubimage2d() would copy it back into the texture as RGB with alpha. I don't know how you'd do it in direct x.

You have to have some way of drawing the alpha, from both sources, into the alpha of your destination, whether its the backbuffer or the original texture.

Using pixmaps you can do a custom copy routine which does an ADD on the alpha channel and a REPLACE on the RGB channels. Might need to divide the alpha by 2. Or make a `combiner` routine, takes the two sources and outputs to a third pixmap that you use to draw with.

OR you can just have two images. Your original scroll image, render your text to another image with alpha channel, then just drawimage twice. ????