2023-08-16 18:05:49 +08:00
|
|
|
#ifndef SCREENSHOT_H
|
|
|
|
#define SCREENSHOT_H
|
|
|
|
|
|
|
|
#include <QQuickItem>
|
|
|
|
#include <QQuickPaintedItem>
|
|
|
|
#include <QPainter>
|
|
|
|
#include "stdafx.h"
|
|
|
|
|
2023-08-16 23:25:52 +08:00
|
|
|
class ScreenshotBackground : public QQuickPaintedItem
|
|
|
|
{
|
|
|
|
Q_OBJECT;
|
|
|
|
QML_NAMED_ELEMENT(ScreenshotBackground)
|
|
|
|
public:
|
|
|
|
ScreenshotBackground(QQuickItem* parent = nullptr);
|
|
|
|
void paint(QPainter* painter) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
QRect _desktopGeometry;
|
|
|
|
QPixmap _desktopPixmap;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2023-08-16 18:05:49 +08:00
|
|
|
class Screenshot : public QQuickPaintedItem
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
QML_NAMED_ELEMENT(Screenshot)
|
|
|
|
Q_PROPERTY_AUTO(QPoint,start);
|
|
|
|
Q_PROPERTY_AUTO(QPoint,end);
|
2023-08-16 22:23:58 +08:00
|
|
|
Q_PROPERTY_AUTO(QColor,maskColor);
|
2023-08-16 18:05:49 +08:00
|
|
|
public:
|
|
|
|
Screenshot(QQuickItem* parent = nullptr);
|
|
|
|
void paint(QPainter* painter) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
QRect _desktopGeometry;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SCREENSHOT_H
|