New firmware 1.0.11

Announcements of new firmware versions, new features and new applications
Post Reply
mchavez
Site Admin
Posts: 43
Joined: Tue Nov 10, 2020 12:12 am

New firmware 1.0.11

Post by mchavez »

There is a new firmware 1.0.11, mainly with support for download images and display them from SPIFFS.

There are two new functions:
  • downloadPNG, which downloads a PNG image from URL. Returns "true" on success, "false" on failure. Its parameters are:
    • const char* url, image url
    • const char* filename, SPIFFS file to save
    • int width, maximum width of the image
    • int height, maximum height of the image
    • uint8_t* data, pointer to a uint8_t* array to store the image data
    • lv_img_dsc_t* img, pointer to a lv_img_dsc_t* struct where store the decoded PNG image
    • int* progress, pointer to accumulate download progress value. It can be nullptr if not needed
    • int total, initial total value. It can be 0 if not needed
    • void (* onProgress)(int progress, int total)), pointer to a function to show the download progress. It can be nullptr if not needed
This functions uses a proxy to reduce the size of the image. The width and height properties are exclusive, these means that you can only define a maximum width or a maximum height for the image to be scaled maintaining aspect ratio.
  • loadPNG, which loads a PNG image from SPIFFS. Returns "true" on success, "false" on failure. Its parameters are:
    • const char* filename, SPIFFS file to load
    • int width, width of the image
    • int height, height of the image
    • uint8_t* data, pointer to a uint8_t* array to store the image data
    • lv_img_dsc_t* img, pointer to a lv_img_dsc_t* struct where store the decoded PNG image
A more detailed example can be found on Store. Search for "image demo".

We hope you like this new firmware

The TWatchBuilder Team
Post Reply