コード例 #1
0
 def _on_enter(self, instance_program):
     self.app = instance_program
     # print('enter')
     if self.camera is None:
         self.camera = Camera()
     self.camera.play = True
     self.camera.start()
     self.clear_images()
     self.ids.first.texture = None
     self.ids.second.texture = None
コード例 #2
0
    def build(self):
        print("Building self")

        self.camera = Camera(resolution=(640, 480))
        self.camera.play = True
        self.camera.bind(on_texture=self.reloadTexture)

        self.tex = self.camera.texture

        self.canvas = RenderContext()
        self.canvas.add(Rectangle(texure=self.tex))

        self.captureButton = Button(text='Capture')
        self.captureButton.bind(on_press=self.capture)
        self.captureButton.height = '48dp'

        layout = BoxLayout(orientation='vertical')
        #layout.add_widget(self.canvas)
        layout.add_widget(self.captureButton)

        return layout