Commit 6eac0b7e authored by Artem Sidyakin's avatar Artem Sidyakin

Blog-post

- blog-post is even more mostly ready
- removed pics as they're bundled anyway
parent b8313120
This diff is collapsed.
......@@ -3,6 +3,7 @@ import QtQuick.Window 2.11
import QtQuick.Layouts 1.11
import QtQuick.Controls 2.4
import QtMultimedia 5.11
//import Qt.labs.handlers 1.0
Item {
GridLayout {
......@@ -33,50 +34,59 @@ Item {
// border.width: 5
// border.color: "gray"
VideoOutput {
anchors.fill: parent
orientation: cameraUpsideDown ? 180 : 0
fillMode: VideoOutput.PreserveAspectCrop
source: camera
Camera {
id: camera
//cameraState: tabCamera.checked ? Camera.ActiveState : Camera.LoadedState
viewfinder.resolution: Qt.size(848, 480) // picture quality
metaData.orientation: cameraUpsideDown ? 180 : 0
imageCapture {
onCaptureFailed: {
dialogError.textMain = "Some error taking a picture\n" + message;
dialogError.show();
}
onImageCaptured: {
//console.log("photo has been captured")
}
onImageSaved: {
//console.log("photo has been saved:", camera.imageCapture.capturedImagePath)
}
}
onError: {
cameraStatus.text = qsTr("Error: ") + errorString;
console.log(errorCode, errorString);
}
Component.onCompleted: {
//console.log(qsTr("camera orientation:"), camera.orientation);
//console.log(qsTr("camera state:"), camera.cameraState);
//console.log(qsTr("camera status:"), camera.cameraStatus);
//console.log(qsTr("camera supported resolutions:"), imageCapture.supportedResolutions);
Camera {
id: camera
//cameraState: tabCamera.checked ? Camera.ActiveState : Camera.LoadedState
viewfinder.resolution: Qt.size(848, 480) // picture quality
metaData.orientation: cameraUpsideDown ? 180 : 0
// focus {
// focusMode: Camera.FocusMacro
// focusPointMode: Camera.FocusPointCenter
// }
imageCapture {
onCaptureFailed: {
dialogError.textMain = "Some error taking a picture\n" + message;
dialogError.show();
}
onImageCaptured: {
//console.log("photo has been captured")
}
onImageSaved: {
//console.log("photo has been saved:", camera.imageCapture.capturedImagePath)
}
}
onError: {
cameraStatus.text = qsTr("Error: ") + errorString;
console.log(errorCode, errorString);
}
Component.onCompleted: {
//console.log(qsTr("camera orientation:"), camera.orientation);
//console.log(qsTr("camera state:"), camera.cameraState);
//console.log(qsTr("camera status:"), camera.cameraStatus);
//console.log(qsTr("camera supported resolutions:"), imageCapture.supportedResolutions);
// var supRezes = camera.supportedViewfinderResolutions();
// for (var rez in supRezes)
// {
// console.log(supRezes[rez].width, "x", supRezes[rez].height);
// }
}
}
}
}
VideoOutput {
anchors.fill: parent
orientation: cameraUpsideDown ? 180 : 0
fillMode: VideoOutput.PreserveAspectCrop
source: camera
// TapHandler {
// onTapped: console.log(point.position.x, point.position.y)
// }
}
// Image {
// anchors.fill: parent
......
......@@ -17,7 +17,7 @@ ApplicationWindow {
property int maxValue: 70 // degrees for servos (with 20 safety gap)
property int maxSize: 60 // pixels for sliders items and button
property string sliderColor: "transparent" // perhaps some styling will take place
property bool cameraUpsideDown: false // if you need to rotate viewfinder to 180
property bool cameraUpsideDown: true // if you need to rotate viewfinder to 180
Backend { id: backend }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment