# Snapshot (/examples/others/snapshot)



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

Snapshot a container into an image [#snapshot-a-container-into-an-image]

<LvglExampleBrief>
  Capture a widget tree on press and release with 

  `lv_snapshot_take`

  .
</LvglExampleBrief>

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.

<LvglExample name="lv_example_snapshot_1" path="others/snapshot/lv_example_snapshot_1" />
