alpha

How to alpha mask a color

混江龙づ霸主 提交于 2019-12-05 02:39:44
问题 Working in Android (1.5), I have a hundred or so grayscale images in the form of byte arrays. I want to use the images as alpha masks for drawing solid colors in a Canvas. The images are fixed but the colors can change. I can create Bitmap objects for each image/color combination, but that seems terribly inefficient. What would be a good way to approach this problem, in terms of both memory and speed? (I need to do this many times for each image/color combo.) 回答1: I think I found the answer I

Does the delphi TBitmap support an alpha channel

只谈情不闲聊 提交于 2019-12-05 02:16:33
问题 I'm hearing people say that it is not. However, I created a TBitmap and cleared the entire area by For I := 1 to bmp.Width do For J := 0 to bmp.Height do bmp.canvas.Pixels[I,J]:= $00000000; Then I drew anti-aliased text onto the bitmap and saved it to file. Upon opening it in gimp it shows the transparency information. Does anyone have a definitive answer on this and if it does work then more information on how it works? I've tried playing around with the last byte and I'm not getting the

Alpha blending with multiple textures leaves colored border

北城余情 提交于 2019-12-04 21:49:06
Following problem: I have two textures and I want to combine these two into a new texture. Thus, one texture is used as background, the other will be overlaid. The overlay texture is getting initialized with glClearColor(1.0, 1.0, 1.0, 0.0). Objects are draw onto the texture, these objects do have alpha values. Now blending between the two textures leaves a white border around the objects. The border comes from the fact that the background color in the second texture is white, isn't it? How can I use alpha blending where I do not have to think about the background color of the overlaying