图片png转.c/.bin
官方地址:v9只支持转换为.c文件
个人地址: 支持批量转换.c/.bin文件
我下载了官方的LVGLImage.py文件,封装了界面调用。
LVGLImage.exe
sh
D:\JetBrains\LVGLConverter\dist>LVGLImage.exe -h
usage: LVGLImage.exe [-h] [--ofmt {C,BIN,PNG}]
[--cf {L8,I1,I2,I4,I8,A1,A2,A4,A8,ARGB8888,XRGB8888,RGB565,RGB565_SWAPPED,RGB565A8,ARGB8565,RGB888,AUTO,RAW,RAW_ALPHA,ARGB8888_PREMULTIPLIED}]
[--rgb565dither] [--premultiply]
[--compress {NONE,RLE,LZ4}] [--align [byte]]
[--background [color]] [--nemagfx] [-o OUTPUT]
[--name NAME] [-v]
input
LVGL PNG to bin image tool.
positional arguments:
input the filename or folder to be recursively converted
optional arguments:
-h, --help show this help message and exit
--ofmt {C,BIN,PNG} output filename format, C or BIN
--cf {L8,I1,I2,I4,I8,A1,A2,A4,A8,ARGB8888,XRGB8888,RGB565,RGB565_SWAPPED,RGB565A8,ARGB8565,RGB888,AUTO,RAW,RAW_ALPHA,ARGB8888_PREMULTIPLIED}
bin image color format, use AUTO for automatically
choose from I1/2/4/8
--rgb565dither use dithering to correct banding in gradients
--premultiply pre-multiply color with alpha
--compress {NONE,RLE,LZ4}
Binary data compress method, default to NONE
--align [byte] stride alignment in bytes for bin image
--background [color] Background color for formats without alpha
--nemagfx export color palette for I8 images in a format
compatible with NEMA accelerator
-o OUTPUT, --output OUTPUT
Select the output folder, default to ./output
--name NAME Specify name for output file. Only applies when input
is a file, not a directory. (Also used for variable
name inside .c file when format is 'C')
-v, --verbose
使用--只支持png转换
LVGLImage.exe --ofmt BIN --cf ARGB8888 scene.png
LVGLConverter.exe
使用

字库转.c/.bin
官方地址:
字库转换的要用node.js,封装太麻烦。还是用官网的吧。