-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCameraItem.qml
More file actions
78 lines (63 loc) · 1.75 KB
/
CameraItem.qml
File metadata and controls
78 lines (63 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import QtQuick 2.14
import QtQuick.Controls 2.14
import QtQuick.Controls.Material 2.14
import QtMultimedia 5.14
Item {
id: root
property string photoLocation: ""
onVisibleChanged: {
if (visible) {
camera.start()
} else {
camera.stop()
}
}
Camera {
id: camera
imageProcessing.whiteBalanceMode: CameraImageProcessing.WhiteBalanceFlash
captureMode: Camera.CaptureStillImage
exposure {
exposureMode: Camera.ExposureAuto
}
focus {
focusMode: Camera.FocusContinuous
focusPointMode: Camera.FocusPointCustom
}
flash.mode: Camera.FlashRedEyeReduction
imageCapture {
onImageCaptured: {
stackView.push(editTool)
editTool.source = preview
}
onImageSaved: {
root.photoLocation = path
}
}
}
VideoOutput {
id: videoOutput
source: camera
anchors.fill: parent
focus : visible // to receive focus and capture key events when visible
orientation: camera.orientation
}
Rectangle {
anchors.bottom: parent.bottom
anchors.bottomMargin: width / 2
anchors.horizontalCenter: parent.horizontalCenter
width: Math.min(root.width, root.height) / 8
height: width
color: "white"
border.width: 3
border.color: Material.color(Material.Grey)
radius: width * 0.5
opacity: 0.5
MouseArea {
anchors.fill: parent
onClicked: {
root.photoLocation = ""
camera.imageCapture.captureToLocation(backend.getTempDir())
}
}
}
}