frame=cvQueryFram(cam);
cloneFrame=cvCloneImage(frame);
image
=Qimage
((const uchar
*)cloneFrame
->imageData,cloneFrame
->width,cloneFrame
->height,
QImage::Format_RGB888),rgbSwapped
();
image = image.scaled(ui->original->size(),
Qt::KeepAspectRatio,
Qt::SmoothTransformation); // my QLabel size is (320,240)
qPainter = newQPainter(&image);
qPainter -> begin(this);
qPainter
->setPen
(QPen(Qt
::red,
1,Qt
::SolidLine));
qPainter->drawRect(0,0,319,239); //can't see the box since (319,239),
qPainter->end();
ui->original->setPixmap(qPixmap::fromImage(image));
frame=cvQueryFram(cam);
cloneFrame=cvCloneImage(frame);
image=Qimage((const uchar*)cloneFrame->imageData,cloneFrame->width,cloneFrame->height,QImage::Format_RGB888),rgbSwapped();
image = image.scaled(ui->original->size(),
Qt::KeepAspectRatio,
Qt::SmoothTransformation); // my QLabel size is (320,240)
qPainter = newQPainter(&image);
qPainter -> begin(this);
qPainter->setPen(QPen(Qt::red,1,Qt::SolidLine));
qPainter->drawRect(0,0,319,239); //can't see the box since (319,239),
qPainter->end();
ui->original->setPixmap(qPixmap::fromImage(image));
To copy to clipboard, switch view to plain text mode
Bookmarks