0
I’m developing an app that requires the front camera to occupy the entire background screen, like the Snapchat app, but using QML the camera with spacing above and below the camera. QML Responsible for the camera:
import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Layouts 1.1
import QtMultimedia 5.5
import QtQuick.Window 2.2
Item {
id: item1
width: 720
height: 1080
property alias camera: camera
property alias video: video
Camera {
id: camera
imageProcessing.whiteBalanceMode: CameraImageProcessing.WhiteBalanceFlash
flash.mode: Camera.FlashRedEyeReduction
}
VideoOutput {
id : video
anchors.fill: parent
orientation: -90
source: camera
focus : visible // to receive focus and capture key events when visible
}
}
The
Item
where you’re putting the camera has 720x1080px. That’s the ratio of the camera image?– bfavaretto
The Item has yes, and the resolution of the cell phone screen is 720x1080
– Pedro Soares
Try
fillMode: VideoOutput.PreserveAspectCrop
within theVideoOutput
.– bfavaretto