资源简介
很好的ubuntu opencv qt 三位一体的摄像头源码,有很强的实用性,请下载参考
代码片段和文件信息
#include “fullScreenWidget.h“
fullScreenWidget::fullScreenWidget()
{
setWindowState(Qt::WindowActive|Qt::WindowFullScreen);
tipWidth = 300; //温馨提示框的宽度
tipHeight = 100; //温馨提示框的高度
infoWidth = 100; //坐标信息框的宽度
infoHeight = 50; //坐标信息框的高度
initFullScreenWidget();
}
void fullScreenWidget::initSelectedMenu()
{
savePixmapAction = new QAction(tr(“保存选区“)this);
cancelAction = new QAction(tr(“重选“)this);
quitAction = new QAction(tr(“退出“)this);
contextMenu = new QMenu(this);
connect(savePixmapActionSIGNAL(triggered())thisSLOT(savePixmap()));
connect(cancelActionSIGNAL(triggered())thisSLOT(cancelSelectedRect()));
connect(quitActionSIGNAL(triggered())thisSLOT(hide()));
}
void fullScreenWidget::savePixmap()
{
QString fileName;
fileName = QFileDialog::getSaveFileName(thistr(“保存图片“)QDir::currentPath()tr(“Images (*.jpg *.png *.bmp)“));
if(fileName.isNull())
return;
shotPixmap.save(fileName);
hide();
}
void fullScreenWidget::loadBackgroundPixmap(const QPixmap &bgPixmap)
{
int widthheight;
width = QApplication::desktop()->size().width();
height = QApplication::desktop()->size().height();
loadBackgroundPixmap(bgPixmap00widthheight);
}
void fullScreenWidget::loadBackgroundPixmap(const QPixmap &bgPixmap int x int y int width int height)
{
loadPixmap = bgPixmap;
screenx = x;
screeny = y;
screenwidth = width;
screenheight = height;
initFullScreenWidget();
}
QPixmap fullScreenWidget::getFullScreenPixmap()
{
initFullScreenWidget();
QPixmap result = QPixmap();
result = QPixmap::grabWindow(QApplication::desktop()->winId()); //抓取当前屏幕的图片
return result;
}
void fullScreenWidget::paintEvent(QPaintEvent *event)
{
QColor shadowColor;
shadowColor= QColor(000100); //阴影颜色设置
painter.begin(this); //进行重绘
painter.setPen(QPen(Qt::blue2Qt::SolidLineQt::FlatCap));//设置画笔
painter.drawPixmap(screenxscreenyloadPixmap); //将背景图片画到窗体上
painter.fillRect(screenxscreenyscreenwidthscreenheightshadowColor); //画影罩效果
switch(currentShotState){
case initShot:
drawTipsText();
break;
case beginShot:
case finishShot:
selectedRect = getRect(beginPointendPoint); //获取选区
drawSelectedPixmap();
break;
case beginMoveShot:
case finishMoveShot:
selectedRect = getMoveAllSelectedRect(); //获取选区
drawSelectedPixmap();
break;
case beginControl:
case finishControl:
selectedRect = getMoveControlSelectedRect();
drawSelectedPixmap();
break;
default:
break;
}
drawXYWHInfo(); //打印坐标信息
painter.end(); //重绘结束
if(currentShotState == finishMoveShot || currentShotState == finishControl){
updateBeginEndPointValue(selectedRect); //当移动完选区后,更新beginPointendPoint;为下一次移动做准备工作
}
}
void fullScreenWidget::keyPressEvent(QKeyEvent *event)
{
if(event->key() == Qt::Key_Escape){
initFullScreenWidget();
hide();
}
}
void fullScreenWidget::mousePressEvent(QMouseEvent *event)
{
//当开始进行拖
相关资源
- ubuntu-16.04.1-server-arm64.iso
- 百度网盘qimo for kids带中文版qimo 2.0
- Ubuntu升级openssh7.8p1快速命令集
- ubuntu下安装jdk和NSG2教程(有详尽步骤
- ubuntu-14.04-desktop-amd64.iso
- Ubuntu64位的交叉编译工具arm-linux-gcc-
- linux下LaTex配置完全指南
- ubuntu的划词工具实现添加单词到本地
- ubuntu12.04环境下直接Floodlight+miniet搭建
- Hadoop安装ubuntu16.04+ hadoop-2.9.1.tar.gz+j
- ubuntu 开机动画实现
- Dell 不重装系统Sata operation RAID ON 改
- 操作系统课设 Ubuntu下运行读者写者问
- cuda 9.0 ubuntu16.04百度云链接
- shadowsocks-libev_2.5.5-1_amd64_Ubuntu14.04.de
- Ubuntu系统:为Qt配置ROS开发环境
- minidwep-gtk-40420-ubuntu-64bit.deb
- ubuntu平台的pyuv播放器
- ubuntu部落PDF
- ubuntu16.04.txt
-
deckli
nk ubuntu系统sdk -
ubuntu系统ffmpeg编译deckli
nk资源包 - ubuntu-10.10-desktop-i386.iso
- 10分钟在Ubuntu12.04安装OpenStack
- UBUNTU LINUX教程
- Ubuntu 11.04 Desktop i386 .iso
- WSL2使用xrdp连接xfce4桌面详细配置教程
- Ubuntu16.04源码安装Mininet
- ubuntu网络调试助手
- ubuntu16.04 amd64 make deb安装包
评论
共有 条评论