mask and image overlay problem
-
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 } } } } }