FluentUI/example/qml/page/T_Screenshot.qml

59 lines
1.4 KiB
QML
Raw Normal View History

2023-08-24 15:50:37 +08:00
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
2023-09-29 19:30:22 +08:00
import Qt.labs.platform 1.0
2023-08-16 18:05:49 +08:00
import "qrc:///example/qml/component"
2023-08-26 17:20:30 +08:00
import "../component"
2023-08-16 18:05:49 +08:00
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-09-08 22:33:23 +08:00
radius: 4
2023-08-18 19:17:45 +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-18 19:17:45 +08:00
}
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-09-29 19:30:22 +08:00
saveFolder: StandardPaths.writableLocation(StandardPaths.AppLocalDataLocation)+"/screenshot"
2023-08-17 22:06:26 +08:00
onCaptrueCompleted:
(captrue)=>{
image.source = captrue
}
2023-08-16 18:05:49 +08:00
}
}