資源簡介
一個簡單的小例子來看一看如何用Qt實現類似QQ的截圖功能,詳情見博客 :http://blog.csdn.net/GoForwardToStep/article/details/54385140
代碼片段和文件信息
#include?“capturescreen.h“
#include?
#include?
#include?
#include?
//?選中矩形8個拖拽點小矩形的寬高;
#define?STRETCH_RECT_WIDTH?6
#define?STRETCH_RECT_HEIGHT?6
CaptureScreen::CaptureScreen(QWidget?*parent)
????:?QWidget(parent)
?????m_currentCaptureState(InitCapture)
{
????initWindow();
????initStretchRect();
????loadBackgroundPixmap();
}
CaptureScreen::~CaptureScreen()
{
}
void?CaptureScreen::initWindow()
{
????this->setMouseTracking(true);
????//?由于存在類似QQ這樣界面始終顯示在最頂層,設置屬性?Qt::WindowStaysOnTopHint;
????this->setWindowFlags(Qt::framelessWindowHint?|?Qt::WindowStaysOnTopHint);
????setWindowState(Qt::WindowActive?|?Qt::WindowFullScreen);
????this->setMouseTracking(true);
}
void?CaptureScreen::initStretchRect()
{
?
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????15195??2017-01-22?14:53??Qt?之?簡單截圖功能(三)實現可拖拽選中區域\capturescreen.cpp
?????文件???????1969??2017-01-20?09:23??Qt?之?簡單截圖功能(三)實現可拖拽選中區域\capturescreen.h
?????目錄??????????0??2017-01-22?15:00??Qt?之?簡單截圖功能(三)實現可拖拽選中區域
-----------?---------??----------?-----??----
????????????????17164????????????????????3
- 上一篇:FAT32文件系統實現
- 下一篇:QPST 各版本(包含12個版本)
評論
共有 條評論