You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

flet-camera-webview

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flet-camera-webview

Камера для Flet через WebView

0.1.4
pipPyPI
Maintainers
1

flet_camera

📸 Кастомный компонент камеры для Flet с WebView + WebSocket.

Установка

pip install flet-camera-webview

Использование

import flet as ft
from flet_camera import CameraWebView


def main(page):
    cam = CameraWebView(page)
    
    def save(e):
        image = cam.get_image_bytes()
        if image:
            with open("photo.jpg", "wb") as f:
                f.write(image)

    page.add(
        ft.Column(
            [
                ft.Stack(
                    [
                        ft.Container(
                            content=cam,
                            border_radius=150,  # 🎯 закругление — круг!
                            clip_behavior=ft.ClipBehavior.HARD_EDGE,
                            alignment=ft.alignment.center,
                            bgcolor=ft.colors.BLACK
                        )
                    ],
                    width=300,
                    height=300,
                    expand=False
                ),
                ft.ElevatedButton(
                    "📸 Снимок",
                    on_click=save,
                    width=160,
                    height=48,
                    style=ft.ButtonStyle(
                        shape=ft.RoundedRectangleBorder(radius=25),
                        padding=20
                    )
                )
            ],
            alignment=ft.MainAxisAlignment.CENTER,
            horizontal_alignment=ft.CrossAxisAlignment.CENTER
        )
    )



ft.app(target=main, view=ft.WEB_BROWSER)

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts