I'll describe my overall goal in case the question I asked isn't in the best form to get the answer I'm looking for. I have a sphere of words or "word ball" that spins around the X axis. As words spin to the back (Z coordinate goes from -1 to 1, front to back), I intend to change the size and the opacity of each word so that words in "front" are 100% opaque and full-sized and words in back are smaller and somewhat transparent. I would prefer to do this with straight Delphi code and avoid things like Direct3D, etc. I already have the rotation code working fine. I just need to implement my Z coordinate based perceptual shading idea.
When I create the word ball I dynamically create a TImage component for each word. I "print" the word to the TImage bitmap using the TCanvas.TextOut() method in a centered manner. I intend to use BitBlt to copy that bitmap to the correct location in the main Canvas that holds the word ball, because BitBlt is fast and can resize bitmaps on-the-fly, meeting one of the requirements for my perceptual shading operation.
But I don't know the best way to facilitate the Alpha blending. I know that Windows has the AlphaBlend() call and it seems fairly straightforward to use. But I would need to know how to create a bitmap that is a copy of the per-word TImage component that has an alpha channel. Note, in my case the entire bitmap will have a uniform value for the alpha channel since I want the opacity to be applied uniformly to the entire word, based on it's Z coordinate.
Does a dynamically created TImage component with a bitmap made by using TCanvas.TextOut() have an Alpha channel? If not, how do I create one, or create a copy of a TImage bitmap in real time that does have an Alpha channel to be passed to the AlphaBlend() call? If there's a better way to do all this just let me know.