Problem: The size or resolution of the kivy camera is small

Viewed 204

Why is the screen size of the camera on the screen so small?While I adjusted the full screen size.When I change the resolution, the application does not come up on the phone . With opencv resolution 640, 480 full screen is displayed Sorry my English is not good

from kivy.app import App
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
# import time
Builder.load_string('''
<CameraClick>:
    BoxLayout: 
        id:boxz  
        orientation: 'vertical'
        Camera:
            id: camera
            size_hint: None , None
            size: boxz.width , boxz.height
            pos_hint :{"center_x":.5}
            resolution: (640, 480)
            play: False
        ToggleButton:
            text: 'Play'
            on_press: camera.play = not camera.play
            size_hint_y: None
            height: '48dp'
        Button:
            text: 'Capture'
            size_hint_y: None
            height: '48dp'
            on_press: root.capture()
''')


class CameraClick(BoxLayout):
    def capture(self):
        '''
        Function to capture the images and give them the names
        according to their captured time and date.
        '''
        camera = self.ids['camera']
        # timestr = time.strftime("%Y%m%d_%H%M%S")
        camera.export_to_png("11.png")
        print("Captured")


class TestCamera(App):

    def build(self):
        return CameraClick()


TestCamera().run()

enter image description here enter image description here

0 Answers
Related