Jump to content

[Need Help] ARGB888 support in framebuffer


topsecret9x

Recommended Posts

Hi,

Now I'm developing GUI for a board, and I found that ugfx has the many usefull functions I can use, but now I'm facing a problem that:
- My board is using framebuffer, and I alr tested imagebox with 2-byte images such as RGB565 - BMP files, it works fine.
- But my aim is drawing a GUI can be fully transparent, it's mean I MUST to use ARGB888 4-byte - which doesn't supported in driver/gdisp/framebuffer, and now I don't know how to this.

Please help me in this case. I really appreciate that.

Thank you for reading. Have a nice day.

Link to comment
Share on other sites

Whilst the framebuffer driver supports 32bit color pixels, uGFX itself currently has no support for alpha. Alpha is complicated and is outside the design spec for uGFX v2.x. Whilst we are considering adding support from the ground up for v3 or v4 that is not going to help you now.

There are two possible solutions currently...

1. Nominate a color as your transparent color eg HTML2COLOR (0x000001) and then hack the driver so that whenever you see that color in the driver replace it with the real transparent color code eg 0xff000000; or,

2. If you use GDISP_PIXELFORMAT_RGB888 in both the driver and user color space you may be able to directly pass the alpha colors with the alpha bits set as uGFX won't mask the unneeded bits if there is no color space conversion required. You just won't be able to use the uGFX color macros to generate those alpha values. As the framebuffer driver stores 32 bits per rgb888 value anyway you shouldn't need to change the framebuffer driver.

Link to comment
Share on other sites

  • 1 month later...
33 minutes ago, Joel Bodenmann said:

Hello @topsecret9x and welcome to the µGFX community!

@inmarket pretty much said everything there is to say. However, just for completeness I'd like to point you towards this solution which uses a slightly modified pixmap to work with alpha: 

Whether or not that is useful depends a lot on your application & platform.

thank you again, @ Joel Bodenmann

Link to comment
Share on other sites

You're welcome.

One thing though: Can you please stop quoting the previous post all the time? It makes it very hard to read through a topic. You can reply to a topic without quoting the previous message. Quoting is really just helpful if you refer to just a specific part of a previous message or a message that was mentioned quite a few posts ago.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...