pVideo = video;
pViewer = 0;
vconfig = g_pManager->FindVideoDeviceConfig(pVideo->GetIntfName(), pVideo->GetNodeName(), true);
pVOptions = new CVideoOptions();
pVOptions->SetXML(vconfig);
pVideo->SetConfiguration(vconfig);
r = pVideo->Open();
assert(pWidget != NULL);
pWidget->setAutoFillBackground(true);
pWidget
->setBackgroundRole
(QPalette::Base);
setCentralWidget(pWidget);
//CImagePanelRGB is another class
CCamPanel *pViewer;
pViewer = new CImagePanelRGB(pVideo, pWidget);
// CBasicPanel is another class
CBasicPanel *pLastSnapshot;
pLastSnapshot = new CBasicPanel("snapshot", "Last snapshot", CCamPanel::RGB, pWidget);
if (pViewer) {
connect(pViewer,
SIGNAL(ChangedVisibleSize
(const QSize &)),
this,
SLOT(DeviceChangedSize
(const QSize &)));
viewsize = pVideo->GetSize();
painter.begin(&blackimg);
painter.fillRect(0, 0, viewsize.width(), viewsize.height(), Qt::black);
painter.setPen(Qt::yellow);
painter.drawText(0, 0, viewsize.width(), viewsize.height(), Qt::AlignCenter, tr("Your last saved snapshot appears here"));
painter.end();
if (pLastSnapshot != 0)
{
pLastSnapshot->SetSize(viewsize);
pLastSnapshot->SetImage(0, blackimg.toImage());
pLastSnapshot->hide();
}
pViewer->show();
}
pVideo = video;
pViewer = 0;
vconfig = g_pManager->FindVideoDeviceConfig(pVideo->GetIntfName(), pVideo->GetNodeName(), true);
pVOptions = new CVideoOptions();
pVOptions->SetXML(vconfig);
pVideo->SetConfiguration(vconfig);
r = pVideo->Open();
pWidget = new QWidget(this );
assert(pWidget != NULL);
pWidget->setAutoFillBackground(true);
pWidget->setBackgroundRole(QPalette::Base);
pWidget->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
setCentralWidget(pWidget);
//CImagePanelRGB is another class
CCamPanel *pViewer;
pViewer = new CImagePanelRGB(pVideo, pWidget);
// CBasicPanel is another class
CBasicPanel *pLastSnapshot;
pLastSnapshot = new CBasicPanel("snapshot", "Last snapshot", CCamPanel::RGB, pWidget);
if (pViewer) {
QSize viewsize;
QPainter painter;
connect(pViewer, SIGNAL(ChangedVisibleSize(const QSize &)), this, SLOT(DeviceChangedSize(const QSize &)));
viewsize = pVideo->GetSize();
QPixmap blackimg(viewsize);
painter.begin(&blackimg);
painter.fillRect(0, 0, viewsize.width(), viewsize.height(), Qt::black);
painter.setPen(Qt::yellow);
painter.drawText(0, 0, viewsize.width(), viewsize.height(), Qt::AlignCenter, tr("Your last saved snapshot appears here"));
painter.end();
if (pLastSnapshot != 0)
{
pLastSnapshot->SetSize(viewsize);
pLastSnapshot->SetImage(0, blackimg.toImage());
pLastSnapshot->hide();
}
pViewer->show();
}
To copy to clipboard, switch view to plain text mode
Bookmarks