I'm trying to write a color with an alpha channel to LFB.
For example in my code I do this:
Code: Select all
put_pixel_lfb_mem(50, 20, 0xFFFFFF);
put_pixel_lfb_mem(51, 20, 0x3FFFFFFF);
How can I draw pixels with an alpha channel?
Thanks.
Code: Select all
put_pixel_lfb_mem(50, 20, 0xFFFFFF);
put_pixel_lfb_mem(51, 20, 0x3FFFFFFF);
You just did. But putting an alpha value in the framebuffer is not going to do anything.mrjbom wrote:How can I draw pixels with an alpha channel?
You should be able to see what's behind the monitor, obviouslykzinti wrote:What do you expect to happen? Why would the colour be different? What should it be?
Well, how can I achieve a transparency effect?kzinti wrote:You just did. But putting an alpha value in the framebuffer is not going to do anything.
You have to combine the two pixels yourself.mrjbom wrote:Well, how can I achieve a transparency effect?kzinti wrote:You just did. But putting an alpha value in the framebuffer is not going to do anything.
Yes, that's a good idea. I solved my problem, thank you.BenLunt wrote:You have to combine the two pixels yourself.mrjbom wrote:Well, how can I achieve a transparency effect?kzinti wrote:You just did. But putting an alpha value in the framebuffer is not going to do anything.
For example, even in 32-bit pixels, they are only 24-bits wide, eight each color. To create a transparent looking pixel, you have to read what is already there, then combine it with the new pixel and place it back.
Ben
- http://www.fysnet.net/the_graphical_user_interface.htm