FluentUI/example/qml/page/T_Screenshot.qml

50 lines
1.0 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{
anchors{
top: parent.top
topMargin: 14
}
text:"Open Screenshot"
onClicked: {
screenshot.open()
}
}
}
2023-08-17 22:06:26 +08:00
Image{
id:image
Layout.preferredHeight: 400
Layout.preferredWidth: 400
fillMode: Image.PreserveAspectFit
2023-08-18 12:45:16 +08:00
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)=>{
2023-08-17 23:03:00 +08:00
//C:/Users/zhuzi/Pictures/1692283885126.png
2023-08-17 22:06:26 +08:00
image.source = captrue
}
2023-08-16 18:05:49 +08:00
}
}