-
Notifications
You must be signed in to change notification settings - Fork 12
/
pe_qscreendialog.h
54 lines (44 loc) · 1.25 KB
/
pe_qscreendialog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef PE_QSCREENDIALOG_H
#define PE_QSCREENDIALOG_H
#include <QDialog>
#include <QshowEvent>
#include <QPainter>
#include <QApplication>
#include <QDesktopWidget>
#include <QCursor>
#define SCREENDIALOG_SELECTMODE_SNIP 1
#define SCREENDIALOG_SELECTMODE_REGION 2
class pe_qScreenDialog : public QDialog
{
Q_OBJECT
public:
pe_qScreenDialog(QDialog *parent);
~pe_qScreenDialog();
void paintEvent(QPaintEvent *event) override;
void keyPressEvent(QKeyEvent *event) override;
void mousePressEvent(QMouseEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
void mouseReleaseEvent(QMouseEvent *event) override;
void drawGreyBackground();
void drawSelectArea();
void updateCursor();
void BeginSnip();
void BeginSelectViewRegion();
QPixmap getSnapshotPixmap();
QImage convertQPixmapToGreyQImage(QPixmap&);
QRect getRect();
signals:
void SIGNAL_OnSelectDone();
void SIGNAL_OnCaptureDone();
void SIGNAL_OnCaptureExit();
void SIGNAL_OnCaptureReady();
private:
int m_SelectType;
bool m_IsDragging;
QPoint m_StartPoint, m_EndPoint;
QRect m_SRect;
QPixmap m_ResScreenPixmap, m_FinalPixmap, m_HelperPixmap;
QImage m_GreyImage;
QCursor m_cursor_tl, m_cursor_tr, m_cursor_bl, m_cursor_br;
};
#endif // PE_QSCREENDIALOG_H