Unsolved How to put borders for a camera preview in QML
-
Hi,
I have a query, how can we put border for an Camera in QML.
Thanks,
-
Hi! Just place the video output on top of a rectangle:
import QtQuick 2.7 import QtQuick.Controls 2.0 import QtQuick.Layouts 1.0 import QtMultimedia 5.6 ApplicationWindow { visible: true width: 640 height: 480 title: qsTr("Hello World") Rectangle { id: rect width: 300 height: 200 color: "red" border.color: "red" border.width: border_width radius: border_width property int border_width: 10 Camera { id: camera } VideoOutput { id: videoOutput source: camera width: parent.width - rect.border_width*2 height: parent.height - rect.border_width*2 anchors.centerIn: rect } } }
-
Hi @Wieland
Thanks , it is working.
I am customizing your application so i can get dotted borders and at cornered gets highlighted.Similar to the above link image.
Thanks,