FluentUI/example/qml/page/T_Screenshot.qml

56 lines
1.2 KiB
QML
Raw Normal View History

2023-08-16 18:05:49 +08:00
import QtQuick
import QtQuick.Layouts
import QtQuick.Window
import QtQuick.Controls
import FluentUI
import "qrc:///example/qml/component"
FluScrollablePage{
title:"Screenshot"
FluArea{
Layout.fillWidth: true
height: 100
paddings: 10
Layout.topMargin: 20
FluFilledButton{
2023-08-18 19:17:45 +08:00
anchors.verticalCenter: parent.verticalCenter
2023-08-16 18:05:49 +08:00
text:"Open Screenshot"
onClicked: {
screenshot.open()
}
}
}
2023-08-18 19:17:45 +08:00
Rectangle{
2023-08-17 22:06:26 +08:00
Layout.preferredHeight: 400
Layout.preferredWidth: 400
2023-08-18 19:17:45 +08:00
Layout.topMargin: 10
Layout.leftMargin: 4
2023-08-21 11:51:03 +08:00
Layout.bottomMargin: 4
2023-08-18 19:17:45 +08:00
color: FluTheme.dark ? FluColors.Black : FluColors.White
FluShadow{
radius: 0
color: FluTheme.primaryColor.dark
}
Image{
id:image
anchors.fill: parent
fillMode: Image.PreserveAspectFit
asynchronous: true
}
2023-08-17 22:06:26 +08:00
}
2023-08-16 18:05:49 +08:00
FluScreenshot{
id:screenshot
2023-08-17 22:06:26 +08:00
captrueMode: FluScreenshotType.File
2023-08-17 23:03:00 +08:00
saveFolder: FluTools.getApplicationDirPath()+"/screenshot"
2023-08-17 22:06:26 +08:00
onCaptrueCompleted:
(captrue)=>{
image.source = captrue
}
2023-08-16 18:05:49 +08:00
}
}