unleashed-firmware/applications/examples/example_images
Sean Skyhawk 41fcead710
Images linting: ensure that all images conform specification (#3802)
* Change all icons to be white background
* assets: re-processed all *.png images to 1-bit
* assets: also stripped profile data from .pngs
* assets: also stripped datetime from metadata (`-define png:exclude-chunks=date,time`)
* scripts: added image linter and formatter; fbt: added `lint_img` && `format_img` targets; github: integrated image lint step into CI
* scripts: imglint: fixed deprecation warning
* images: applied `format_img`
* fbt: added `lint_all` and `format_all` targets; docs: updated for new targets

Co-authored-by: hedger <hedger@nanode.su>
Co-authored-by: hedger <hedger@users.noreply.github.com>
2024-08-07 11:57:32 +09:00
..
images Images linting: ensure that all images conform specification (#3802) 2024-08-07 11:57:32 +09:00
application.fam [FL-2859,2838] fbt: improvements for FAPs (#1813) 2022-10-06 22:55:57 +09:00
example_images.c [FL-2969] FuriHal: add ADC API (#3583) 2024-04-18 00:17:40 +09:00
ReadMe.md [FL-870] Auto-generated firmware documentation take two (#2944) 2024-03-06 15:25:21 +09:00

Application icons

Source code

Source code for this example can be found here.

General principle

To use icons, do the following:

  • Add a line to the application manifest: fap_icon_assets="folder", where folder points to the folder where your icons are located
  • Add #include "application_id_icons.h" to the application code, where application_id is the appid from the manifest
  • Every icon in the folder will be available as a I_icon_name variable, where icon_name is the name of the icon file without the extension

Example

We have an application with the following manifest:

App(
    appid="example_images",
    ...
    fap_icon_assets="images",
)

So the icons are in the images folder and will be available in the generated example_images_icons.h file.

The example code is located in example_images_main.c and contains the following line:

#include "example_images_icons.h"

Image dolphin_71x25.png is available as I_dolphin_71x25.