Skip to content

Commit e607e13

Browse files
Add camera button
1 parent d5aa2af commit e607e13

File tree

1 file changed

+9
-0
lines changed
  • internal_filesystem/apps/com.example.camtest/assets

1 file changed

+9
-0
lines changed

internal_filesystem/apps/com.example.camtest/assets/camtest.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@
4848
cont.set_size(lv.pct(100), lv.pct(100))
4949
cont.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF)
5050

51+
button = lv.button(cont)
52+
button.set_size(40, 40)
53+
button.align(lv.ALIGN.RIGHT_MID, 0, -20)
54+
def snap_button(e):
55+
print("Picture taken!")
56+
# TODO: keep it on-screen for a while, or save it to storage, or show it in miniature
57+
58+
button.add_event_cb(snap_button,lv.EVENT.CLICKED,None)
59+
5160

5261
from camera import Camera, GrabMode, PixelFormat, FrameSize, GainCeiling
5362

0 commit comments

Comments
 (0)