-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.qml
54 lines (45 loc) · 1.02 KB
/
main.qml
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
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import QtMultimedia 5.5
ApplicationWindow {
visible: true
width: 640
height: 480
title: qsTr("Face Plus")
Camera {
id: camera
deviceId: "0"
imageProcessing.whiteBalanceMode: CameraImageProcessing.WhiteBalanceFlash
exposure {
exposureCompensation: -1.0
exposureMode: Camera.ExposurePortrait
}
flash.mode: Camera.FlashRedEyeReduction
imageCapture {
id: camera_cap
onImageCaptured: {
photoPreview.source = preview
console.debug(camera_cap.capturedImagePath);
}
}
}
VideoOutput {
width: 320
height: 240
source: camera
focus : visible
Keys.onPressed: {
if (event.key === Qt.Key_Left) {
camera_cap.capture();
}
}
}
Image {
id: photoPreview
x: 320
y: 240
width: 320
height: 240
}
}