Using custom images as wallpapers #240
jmi2k
started this conversation in
Show and tell
Replies: 1 comment 4 replies
-
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
One of the first mods I've done to the firmware was adding support for adding a wallpaper to your ATS-mini. I followed a fairly
hackishpragmatic approach:Apply Avoid drawing background color when drawing text #239 onto your working tree to prevent text from drawing on top of your background. This step will not be needed once the PR is merged.The PR was merged so this step is not needed anymore.Transform the desired 320x170 image into a C array of uncompressed pixel data. For that purpose, I used this "File to C style array converter" online tool with the following settings.
uint16_t
.PROGMEM
unchecked.Copy the contents somewhere in the source code and make the symbol accessible from your layout draw function. I just pasted it before said function, but if you want to be smarter you can, for example, define it somewhere else and have an
extern
declaration (this may be useful if you plan to set the same wallpaper for both UI layouts).On your layout draw function, right at the very beginning, push the image to your screen with
pushImage
. In my case, that'sdrawLayoutDefault
insideLayout-Default.cpp
.Note that
IMAGE_WIDTH
,IMAGE_HEIGHT
andimage
must be the same names the tool generated for your particular image, so pay attention there.Compile the firmware and upload it to your device according to the documentation.
In my case, the result is actually very subtle on purpose (although it is more noticeable on real HW than on my display). The image was cropped from this image of the Tsushima Omega Tower I found while reading about VLF on Wikipedia, then heavily processed until I found it pleasing to the eye.
However, nothing prevents you from going the opposite route :)
Have fun! Some good ideas that could turn this into a real feature:
Properly integrate the wallpaper pixel data somewhere into the code, so it can be accessed by many layouts and loaded programmatically.
Support color palettes to reduce the amount of memory needed to store the image.
Support loading images via serial, Bluetooth or Wi-Fi.
Beta Was this translation helpful? Give feedback.
All reactions