Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QML Camera, focus on a custom point
Forum Updated to NodeBB v4.3 + New Features

QML Camera, focus on a custom point

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 557 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    luca
    wrote on last edited by
    #1

    Hi all,
    I need to focus a specific point in the display when capturing image with smartphone camera.
    The code I'm using is:

    Camera {
            id: camera
        
            focus {
                focusMode: Camera.FocusAuto
                focusPointMode: Camera.FocusPointCustom
            }
        }
    
        VideoOutput {
            id: videoView
            anchors.fill: parent
            fillMode: Image.PreserveAspectCrop
            source: camera
            autoOrientation: true
            MouseArea {
                anchors.fill: parent
                onClicked: {
                    var point_x = mouse.x / Screen.width
                    var point_y = mouse.y / Screen.height
                    camera.focus.customFocusPoint = Qt.point(point_x, point_y)
                    camera.searchAndLock()
    
                }
            }
        }
    

    but every time I touch a point in the display it always focus on the center of the display. It seems to ignore the touched points.

    Where do I wrong?

    Thanks

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved