Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!

Capture from the Device Camera

With the QML Multimedia components, you can access and capture from the device camera.

View the Device Camera Output

This example uses the Camera component to simply view the device camera output.

 import Felgo 3.0
 import QtQuick 2.0
 import QtMultimedia 5.9

 App {

   // Displays a title bar and is used for navigation between pages
   NavigationStack {

     Page {
       title: "Camera"

       Camera {
         id: camera
       }

       VideoOutput {
         anchors.fill: parent
         source: camera
         autoOrientation: true
       }
     }
   }
 }

Capture Image from Device Camera

You can also use the Multimedia components components to capture images or videos from the camera. You can look at the CameraCapture components to find an example.

As a convenient alternative, Felgo also provides methods for this with the NativeUtils. This example opens the native camera dialog to take a picture.

 import Felgo 3.0
 import QtQuick 2.9

 App {
   id: app

   NavigationStack {

     Page {

       AppImage {
         id: image
         anchors.fill: parent
         // important to automatically rotate the image taken from the camera
         autoTransform: true
         fillMode: Image.PreserveAspectFit
       }

       AppButton {
         anchors.centerIn: parent
         text: "Display CameraPicker"
         onClicked: {
           nativeUtils.displayCameraPicker("test")
         }
       }

       Connections {
         target: nativeUtils
         onCameraPickerFinished: {
           if(accepted) image.source = path
         }
       }
     }
   }
 }

Scan a QR Code with the Camera

For QR Code scanning, we recommend this library: https://github.com/ftylitak/qzxing

We also used it in this open-source example app: Qt World Summit Conference App

More Frequently Asked Development Questions

Find more examples for frequently asked development questions and important concepts in the following guides: