`Camera`control
Closes #1281
Test Code
import flet as ft
def main(page: ft.Page):
page.window_always_on_top = True
page.theme_mode = ft.ThemeMode.LIGHT
page.horizontal_alignment = ft.CrossAxisAlignment.CENTER
page.add(
cam := ft.Camera(
width=350,
height=350,
resolution_preset=ft.ResolutionPreset.MAX,
error_content=ft.ProgressRing(),
exposure_offset=0,
exposure_mode=ft.ExposureMode.AUTO,
image_format_group=ft.ImageFormatGroup.JPEG,
zoom_level=3,
),
ft.ElevatedButton("Capture Image", on_click=lambda _: cam.capture_image()),
ft.ElevatedButton("Start Video Recording", on_click=lambda _: cam.start_video_recording()),
ft.ElevatedButton("Stop Video Recording", on_click=lambda _: cam.stop_video_recording()),
)
ft.app(target=main)
Notes
Control not showing up as expected atm.
We need to find a better way to pass the list available cameras (which is to be run before calling runApp) to the CameraControl in flet_camera package.
Ref: Docs
await asyncio.get_running_loop().run_in_executor( File "C:\Users\Muddassir Farooq\AppData\Local\Programs\Python\Python312\Lib\concurrent\futures\thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Users\Muddassir Farooq\Desktop\Python Projects\Flet Projects\Ambassadors\test.py", line 10, in main cam := ft.Camera( ^^^^^^^^^ AttributeError: module 'flet' has no attribute 'Camera'
It wasn't merged yet
By when, more or less, will this camera functionality be implemented? I need it urgently!
No ETA for now, please be patient.
While the functionality is not officially launched, could you help me call it in some way?
How I can help for this functionality is available for use? @ndonkoHenri
@ndonkoHenri please merge this to main. This one camera image capture feature is going to change my whole decision on choosing flet. Please help enable this functionality. Thank you.
It's not ready yet, sorry.
Hi @ndonkoHenri,
Is there already an ETA?
I'm waiting on this control to develop a new app.
Thanks in advance for the effort!
Will Camera be in 0.26?