Fade/Grey portions of the screen #1119
Replies: 1 comment 2 replies
-
This is not something I have done. Clearly a large area of the screen has to be redrawn with reduced intensity colours. You don't say what processor or pixel count screen you have, or whether it is readable. There is an alphaBlend function to mix 2 colours, see example. There are also functions to read the screen areas and write back. There is a readRect() function that was written to move areas of the screen when used with pushRect(), one complication is that the 16 bit colour values are byte swapped when using readRect() so it is compatible with the SPI byte output order. However bytes can be swapped easily. Here is one approach:
If the screen cannot be read then this will not work. As you may see the line scan it might be better visually to have the line scan converge towards the central section. Here is another simple cross hatching technique that should be fast:
|
Beta Was this translation helpful? Give feedback.
-
Hey all,
Is there a decent way to basically fade or grey a portion of the screen based upon what is already painted? The use case here is I've created a window-system where a dialog can pop up on top of the existing display and that display is built of several separate sprites which each draw their portion on their own. I've got a way to halt the screen sprites from drawing while I put up the dialog "on top", but to make it super clear that the dialog is the user's main focus, I'd love to paint the surrounding areas a dimmer/faded version of itself to make it super obvious.
The one thought I had was to use the screen capture which reads every pixel into memory - modify the parts I want to grey out, and then send the image back to the screen before putting the dialog up. But that seems really intense in terms of bandwidth over SPI and processing side.
Any experienced/brilliant thoughts? :)
Beta Was this translation helpful? Give feedback.
All reactions