Skip to content

Cameracontrol #3354

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 2 commits into from
Closed

Cameracontrol #3354

wants to merge 2 commits into from

Conversation

ndonkoHenri
Copy link
Contributor

@ndonkoHenri ndonkoHenri commented May 25, 2024

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

# Conflicts:
#	client/ios/Runner/Info.plist
#	client/lib/main.dart
#	client/pubspec.lock
@kacper-the-programmer
Copy link
Contributor

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

@deviagomendes
Copy link

By when, more or less, will this camera functionality be implemented? I need it urgently!

@ndonkoHenri
Copy link
Contributor Author

No ETA for now, please be patient.

@deviagomendes
Copy link

deviagomendes commented Jun 20, 2024

While the functionality is not officially launched, could you help me call it in some way?

@MichaelDeMattos
Copy link

How I can help for this functionality is available for use? @ndonkoHenri

@nitinss17
Copy link

@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.

@ndonkoHenri
Copy link
Contributor Author

It's not ready yet, sorry.

@seppeV2
Copy link

seppeV2 commented Oct 5, 2024

Hi @ndonkoHenri,

Is there already an ETA?

I'm waiting on this control to develop a new app.

Thanks in advance for the effort!

@yunguangli
Copy link

Will Camera be in 0.26?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Camera control
8 participants