⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mycam.cpp.svn-base

📁 一个简单的摄像头播放程序,用qt做的界面
💻 SVN-BASE
字号:
#include "mycam.h"#include "v4l2.h"MyCam::MyCam()	:QDialog(){	ui.setupUi(this);	connect(ui.recordButton, SIGNAL(clicked()), this, SLOT(recordImage()));//	connect(stopButton, SIGNAL(clicked()), this, SLOT(stopVideo()));//	connect(recordButton, SIGNAL(clicked()), this, SLOT(recordVideo()));	connect(ui.recordButton, SIGNAL(clicked()), this, SLOT(buttonDisabled()));	connect(ui.stopButton, SIGNAL(clicked()), this, SLOT(buttonEnabled()));		display();	}void MyCam::recordVideo(){		}void MyCam::recordImage(){		}void MyCam::stopVideo(){		}void MyCam::flushBuff(){	QImage image;	read_frame (&pd);	image.loadFromData((uchar*)pd.buffers[pd.buf.index].start,			                     pd.fmt.fmt.pix.sizeimage);	ui.displayLabel->setPixmap(QPixmap::fromImage(image));	return_data(&pd);	}void MyCam::display(){	timer = new QTimer();	timer->start(40);	pd.dev_name = "/dev/video0";	init_dev(&pd);	connect(timer, SIGNAL(timeout()), this, SLOT(flushBuff()));	}void MyCam::buttonDisabled(){	ui.recordButton->setDisabled(TRUE);	}void MyCam::buttonEnabled(){	ui.recordButton->setEnabled(TRUE);	}void MyCam::paintEvent(QPaintEvent *event){	QImage image;	read_frame (&pd);	image.loadFromData((uchar*)pd.buffers[pd.buf.index].start,			                     pd.fmt.fmt.pix.sizeimage);	ui.displayLabel->setPixmap(QPixmap::fromImage(image));	return_data(&pd);		}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -