fix(snapshot): set data_size on returned dsc (#4972)

This commit is contained in:
Niklas Fiekas
2023-12-11 12:45:46 +01:00
committed by GitHub
parent 74d0a816a4
commit 9ba2992582
3 changed files with 20 additions and 19 deletions

View File

@@ -37,7 +37,7 @@ void update_snapshot(lv_obj_t * obj, lv_obj_t * img_snapshot)
```
### Use Existing Buffer
If the snapshot needs update now and then, or simply caller provides memory, use API `lv_res_t lv_snapshot_take_to_buf(lv_obj_t * obj, lv_img_cf_t cf, lv_img_dsc_t * dsc, void * buf, uint32_t buff_size);` for this case. It's caller's responsibility to alloc/free the memory.
If the snapshot needs update now and then, or simply caller provides memory, use API `lv_res_t lv_snapshot_take_to_buf(lv_obj_t * obj, lv_img_cf_t cf, lv_img_dsc_t * dsc, void * buf, uint32_t buf_size);` for this case. It's caller's responsibility to alloc/free the memory.
If snapshot is generated successfully, the image descriptor is updated and image data will be stored to provided `buf`.