Replace NetworkCamera with NetworkMJPGImage

This commit is contained in:
fieldOfView 2018-10-25 21:58:21 +02:00
parent 890ddc015e
commit c187b6a25c
5 changed files with 30 additions and 47 deletions

View file

@ -34,33 +34,23 @@ Item {
z: 999;
}
Cura.CameraView {
Cura.NetworkMJPGImage {
id: cameraImage
anchors.horizontalCenter: parent.horizontalCenter;
anchors.verticalCenter: parent.verticalCenter;
height: Math.round((imageHeight === 0 ? 600 * screenScaleFactor : imageHeight) * width / imageWidth);
onVisibleChanged: {
if (visible) {
if (camera != null) {
camera.start();
if (cameraUrl != null) {
start();
}
} else {
if (camera != null) {
camera.stop();
}
}
}
Connections
{
target: camera
onNewImage: {
if (cameraImage.visible) {
cameraImage.image = camera.latestImage;
cameraImage.update();
if (cameraUrl != null) {
stop();
}
}
}
source: cameraUrl
width: Math.min(imageWidth === 0 ? 800 * screenScaleFactor : imageWidth, maximumWidth);
z: 1
}