Working with a camera
It is very common that almost all our personal devices have a camera. So you could find thousands of ways to use a camera signal in your app. In this recipe, we want to create an app that takes control of the camera present in a device.
Getting ready
Actually, you need to have the correct installation of the packages that permits you to interact with a camera. You can review http://kivy.org/docs/faq.html#gstreamer-compatibility to check if your installation is suitable.
How to do it…
We are going to use the Python and KV files in this recipe. The KV file will deal with the camera and button to interact with it. The Python code is one of our usual Python files with the definition of the root widget. Let's follow these steps:
In the KV file, define the
<MyW>
rule.In the rule, define
BoxLayout
with a vertical orientation.Inside the
Layout
, define the camera widget with play property asfalse
.Also, define the
ToggleButton
with the press property swifts between play and...