lv_snapshot.h
API reference for lv_snapshot.h
Functions
lv_snapshot_take
Take snapshot for object with its children, create the draw buffer as needed.
lv_draw_buf_t * lv_snapshot_take(lv_obj_t *obj, lv_color_format_t cf)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | the object to generate snapshot. |
cf | lv_color_format_t | color format for generated image. |
Returns: lv_draw_buf_t * — a pointer to an draw buffer containing snapshot image, or NULL if failed.
lv_snapshot_create_draw_buf
Create a draw buffer to store the snapshot image for object.
lv_draw_buf_t * lv_snapshot_create_draw_buf(lv_obj_t *obj, lv_color_format_t cf)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | the object to generate snapshot. |
cf | lv_color_format_t | color format for generated image. |
Returns: lv_draw_buf_t * — a pointer to an draw buffer ready for taking snapshot, or NULL if failed.
lv_snapshot_reshape_draw_buf
Reshape the draw buffer to prepare for taking snapshot for obj. This is usually used to check if the existing draw buffer is enough for obj snapshot. If return LV_RESULT_INVALID, you should create a new one.
lv_result_t lv_snapshot_reshape_draw_buf(lv_obj_t *obj, lv_draw_buf_t *draw_buf)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | the object to generate snapshot. |
draw_buf | lv_draw_buf_t * | the draw buffer to reshape. |
lv_snapshot_take_to_draw_buf
Take snapshot for object with its children, save image info to provided buffer.
lv_result_t lv_snapshot_take_to_draw_buf(lv_obj_t *obj, lv_color_format_t cf, lv_draw_buf_t *draw_buf)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | the object to generate snapshot. |
cf | lv_color_format_t | color format for new snapshot image. It could differ with cf of draw_buf as long as the new cf will fit in. |
draw_buf | lv_draw_buf_t * | the draw buffer to store the image result. It's reshaped automatically. |
Returns: lv_result_t — LV_RESULT_OK on success, LV_RESULT_INVALID on error.
lv_snapshot_free
> Deprecated: Use lv_draw_buf_destroy instead.
Free the snapshot image returned by lv_snapshot_take
void lv_snapshot_free(lv_image_dsc_t *dsc)| Name | Type | Description |
|---|---|---|
dsc | lv_image_dsc_t * | the image descriptor generated by lv_snapshot_take. |
lv_snapshot_take_to_buf
Take snapshot for object with its children, save image info to provided buffer.
> Deprecated: Use lv_snapshot_take_to_draw_buf instead.
lv_result_t lv_snapshot_take_to_buf(lv_obj_t *obj, lv_color_format_t cf, lv_image_dsc_t *dsc, void *buf, uint32_t buf_size)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | the object to generate snapshot. |
cf | lv_color_format_t | color format for generated image. |
dsc | lv_image_dsc_t * | image descriptor to store the image result. |
buf | void * | the buffer to store image data. It must meet align requirement. |
buf_size | uint32_t | provided buffer size in bytes. |
Returns: lv_result_t — LV_RESULT_OK on success, LV_RESULT_INVALID on error.
Dependencies
lv_obj.hstdint.hstddef.h
Indirect dependencies
lv_anim.hlv_area.hlv_array.hlv_assert.hlv_bidi.hlv_color.hlv_color_op.hlv_conf_internal.hlv_conf_kconfig.hlv_display.hlv_draw.hlv_draw_arc.hlv_draw_blur.hlv_draw_buf.hlv_draw_image.hlv_draw_label.hlv_draw_line.hlv_draw_rect.hlv_draw_triangle.hlv_event.hlv_ext_data.hlv_flex.hlv_font.hlv_fs.hlv_grad.hlv_grid.hlv_group.hlv_image_decoder.hlv_image_dsc.hlv_indev.hlv_layout.hlv_ll.hlv_log.hlv_math.hlv_matrix.hlv_mem.hlv_obj_class.hlv_obj_draw.hlv_obj_event.hlv_obj_pos.hlv_obj_property.hlv_obj_property_names.hlv_obj_scroll.hlv_obj_style.hlv_obj_style_gen.hlv_obj_tree.hlv_palette.hlv_profiler.hlv_profiler_builtin.hlv_sprintf.hlv_string.hlv_style.hlv_style_gen.hlv_style_properties.hlv_symbol_def.hlv_text.hlv_tick.hlv_timer.hlv_types.h
How is this guide?
Last updated on