Description
What MCU/Processor/Board and compiler are you using?
Nim/gcc
What do you want to achieve?
I am trying to reproduce using Nim this example. But I think that maybe I am not understanding correctly what is done.
What have you tried so far?
So far, I tried to do something similar to python:
- read the binary file
- create
lv_img_dsc_t
and populateddata
anddata_size
Do I have to do something with header
?
Code to reproduce
I see that in C it uses:
LV_IMG_DECLARE(img_cogwheel_argb);
lv_img_set_src(obj, &img_cogwheel_argb);
I see that in python uses:
try:
with open('../assets/img_cogwheel_argb.png', 'rb') as f:
png_data = f.read()
except:
print("Could not find img_cogwheel_argb.png")
sys.exit()
img_cogwheel_argb = lv.img_dsc_t({
'data_size': len(png_data),
'data': png_data
})
I understand what python is trying to do. It is less clear to me what happens on the C side.
Screenshot and/or video
N/A