Android QT-qml图像定向
我正在尝试使用Qt为android构建一个应用程序。Android QT-qml图像定向,android,image,qt,qml,orientation,Android,Image,Qt,Qml,Orientation,我正在尝试使用Qt为android构建一个应用程序。 我写了一个非常简单的代码来帮助回答我的问题 import QtQuick 2.9 import QtQuick.Controls 2.2 ApplicationWindow { property string imagePath: "/storage/emulated/0/DCIM/camera/20180910_141351.jpg" visible: true Image { id: picture ancho
我写了一个非常简单的代码来帮助回答我的问题
import QtQuick 2.9
import QtQuick.Controls 2.2
ApplicationWindow {
property string imagePath: "/storage/emulated/0/DCIM/camera/20180910_141351.jpg"
visible: true
Image {
id: picture
anchors.fill: parent
fillMode: Image.PreserveAspectFit
source: "file://" + imagePath
}
}
我正在尝试将手机中的图像添加到应用程序中,我面临的问题如下:
另外,如果我必须写一个代码来做旋转,我怎么知道图像的方向?请注意,在某些情况下,我可能有一个图像列表,因此我需要旋转所有图像。您是否尝试过使用
自动转换属性?(只是一个想法,我不知道它是否有效)该死,那很容易。谢谢,它解决了这个问题