FluentUI/example/qml-Qt6/page/T_Screenshot.qml

58 lines
1.3 KiB
QML
Raw Normal View History

2023-08-24 15:50:37 +08:00
import QtQuick
import QtQuick.Layouts
import QtQuick.Window
import QtQuick.Controls
import FluentUI
2023-09-29 19:30:22 +08:00
import Qt.labs.platform
2023-08-24 15:50:37 +08:00
import "qrc:///example/qml/component"
FluScrollablePage{
title:"Screenshot"
FluArea{
Layout.fillWidth: true
height: 100
paddings: 10
Layout.topMargin: 20
FluFilledButton{
anchors.verticalCenter: parent.verticalCenter
text:"Open Screenshot"
onClicked: {
screenshot.open()
}
}
}
Rectangle{
Layout.preferredHeight: 400
Layout.preferredWidth: 400
Layout.topMargin: 10
Layout.leftMargin: 4
Layout.bottomMargin: 4
2023-09-08 22:33:23 +08:00
radius: 4
2023-08-24 15:50:37 +08:00
color: FluTheme.dark ? FluColors.Black : FluColors.White
FluShadow{
2023-09-08 22:33:23 +08:00
radius: 4
2023-11-02 15:33:59 +08:00
color: FluTheme.primaryColor
2023-08-24 15:50:37 +08:00
}
Image{
id:image
anchors.fill: parent
fillMode: Image.PreserveAspectFit
asynchronous: true
}
}
FluScreenshot{
id:screenshot
captrueMode: FluScreenshotType.File
2023-09-29 19:30:22 +08:00
saveFolder: StandardPaths.writableLocation(StandardPaths.AppLocalDataLocation)+"/screenshot"
2023-08-24 15:50:37 +08:00
onCaptrueCompleted:
(captrue)=>{
image.source = captrue
}
}
}