Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for background images #23

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

EternityForest
Copy link

@EternityForest EternityForest commented Jan 6, 2019

This might be somewhat of a controversial way to do this, because of the complexity and RAM, but I think
caching is useful, because embedded devices should be able to run for decades without issues, and it's only 5kb for a full screen jpg. I don't know what the read disturb effect is like on the M5Stack.

It might be worth getting rid of caching, but that wouldn't be too hard.

Editable textboxes need the background color highlight behind the words, so it looks a little odd, but should still work. No noticeable performance hit despite re-rendering the jpg all the time.

The theme option is background_img, and SD cards and SPIFFS filenames are both supported(Selected by filename, either starting with /spiffs/ or /sd/). I've also got fallback code to use the solid color background if the file is missing.

In the process, I've also abstracted out the "drawBackground" function, which draws a patch of whatever the current background is.

@ropg
Copy link
Collaborator

ropg commented Jan 6, 2019

I like the first looks of it. I can't really play with this for the coming week or two. It would be easier for me and others to understand if the pull request also had the README changes needed to document the feature though.

@EternityForest
Copy link
Author

EternityForest commented Jan 6, 2019 via email

@ropg
Copy link
Collaborator

ropg commented Jun 10, 2019

Looking at this again, sorry to have been away. How are you sure we need caching, it seems to add quite a bit of complexity? Reading from internal flash SPIFFS should be fast and reliable, no?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants