Snapshot

Report on GitHub

Capture a widget's rendered pixels into an image buffer with lv_snapshot_take.

Snapshot a container into an image

Capture a widget tree on press and release with lv_snapshot_take.

A 180x180 container is filled with four star images in an LV_FLEX_FLOW_ROW_WRAP layout. A separate lv_image on the screen is scaled to 128 and rotated 300. Every star is clickable, and both LV_EVENT_PRESSED and LV_EVENT_RELEASED run a callback that destroys the previous snapshot buffer with lv_draw_buf_destroy, takes a fresh one via lv_snapshot_take(parent, LV_COLOR_FORMAT_ARGB8888), and assigns it as the image's source.

How is this guide?

Last updated on

On this page