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. mask and image overlay problem
Forum Updated to NodeBB v4.3 + New Features

mask and image overlay problem

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 1 Posters 101 Views
  • 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.
  • M Offline
    M Offline
    MT34
    wrote last edited by
    #1
    This post is deleted!
    1 Reply Last reply
    0
    • M Offline
      M Offline
      MT34
      wrote last edited by
      #2

      kamera-mask overlyjpg.jpg

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MT34
        wrote last edited by
        #3

        Page {
        id: detailPage
        title: "Detail Page"

        property StackView stackView
        property int selectedIndex: -1
        property real overlayOpacity: 0.5
        
        property var maskImages: [
            "qrc:/images_nose/nose_01.png",
        
        ]
        property string savePath: StandardPaths.writableLocation(StandardPaths.PicturesLocation) + "/QtMultiMedia"
        
        CaptureSession {
            id: captureSession
        
            camera: Camera {
                id: camera
            }
        
            audioInput: AudioInput {}
        
            imageCapture: ImageCapture {
                id: imageCapture
                onImageSaved: (id, path) => {
                    console.log("📸 Fotoğraf kaydedildi:", path)
                }
            }
        
            recorder: MediaRecorder {
                id: recorder
                onRecorderStateChanged: console.log("🎥 Durum:", recorder.recorderState)
                onActualLocationChanged: (path) => console.log("🎞️ Video kaydedildi:", path)
            }
        
            //videoOutput: videoOutput
        
            videoOutput: videoFrame
        
        }
        
        Column {
            anchors.fill: parent
            spacing: 10
            padding: 10
        
            // Kamera + maske alanı
            Rectangle {
                id: previewArea
                width: parent.width * 0.95
                height: parent.height * 0.7
                color: "#000"
        
                // Kamera görüntüsü
                VideoOutput {
                    id: videoFrame
                    anchors.centerIn: parent
                    width: videoFrame.paintedWidth
                    height: videoFrame.paintedHeight
                    fillMode: VideoOutput.PreserveAspectFit
                   }
        
                // Maske overlay (aynı boyut ve pozisyon!)
                Image {
                       id: overlay
                       anchors.fill: videoFrame
                       width: videoFrame.paintedWidth
                       height: videoFrame.paintedHeight
                       source: selectedIndex >= 0 && selectedIndex < maskImages.length ? maskImages[selectedIndex] : ""
                       opacity: overlayOpacity
                       visible: selectedIndex >= 0
                       fillMode: Image.PreserveAspectFit
                       smooth: true
                   }
        
        
                // Kamera kapalıysa bilgilendirme
                Text {
                    anchors.centerIn: parent
                    text: "📷 Kamera görüntüsü buraya gelecek"
                    color: "white"
                    font.pixelSize: 16
                    visible: !camera.active
                }
            }
        
            // Maske seçim satırı
            ScrollView {
                width: parent.width
                height: 60
        
                Row {
                    id: maskRow
                    spacing: 8
                    padding: 4
        
                    Repeater {
                        model: maskImages
                        delegate: Rectangle {
                            width: 48
                            height: 48
                            border.color: index === selectedIndex ? "red" : "#999"
                            border.width: 2
                            radius: 4
        
                            Image {
                                anchors.fill: parent
                                source: modelData
                                fillMode: Image.PreserveAspectFit
                            }
        
                            MouseArea {
                                anchors.fill: parent
                                onClicked: selectedIndex = index
                            }
                        }
                    }
                }
            }
        
        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