If you create a backbuffer that includes an alpha buffer, ie when you set up your Graphics screen you ask for an alpha channel, and your graphics card supports 32-bit graphics with an alpha buffer, then you could put it into OpenGL mode and use glReadPixels() to grab all four channels from the backbuffer. However, blitz is already using that command when you do a GrabPixmap.
The thing here is, when you use alpha transparency on your sprites or whatever, the alpha data is in the source sprite data. The graphics card reads the sprite data and pulls out the alpha channel, then uses the value in the alpha channel to cross fade between the sprite colors and the background colors. But it does not DRAW the alpha channel into the backbuffer's alpha channel. So when you go to grab the full screen, even if it's 32-bit, it won't find any alpha pixel values. In order to get the alpha channel values from the sprite to be written to the backbuffer's alpha channel you will have to use OpenGL and manually set the blend modes such that the source alpha is written to the destination, and if you have overlapping images then you'll want to probably use a multiply blend mode that combines the sprite alpha with the destination alpha, such as DEST_ALPHA. It can be done, but it's not what Blitz is normally set up to do.
Another option is to manually draw sprites into a pixmap using your own alphablending algorithm and then make sure to also draw/combine the alpha values from the sprites into the pixmap's alpha channel.
|