From 79119a08157aa954b3b2ecd18c8384b80a03970f Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 4 Dec 2013 18:46:27 +0100 Subject: draw images directly, without pixmaps --- ftnoir_tracker_aruco/ar_video_widget.cpp | 2 +- ftnoir_tracker_aruco/ar_video_widget.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'ftnoir_tracker_aruco') diff --git a/ftnoir_tracker_aruco/ar_video_widget.cpp b/ftnoir_tracker_aruco/ar_video_widget.cpp index c452a638..9a089213 100644 --- a/ftnoir_tracker_aruco/ar_video_widget.cpp +++ b/ftnoir_tracker_aruco/ar_video_widget.cpp @@ -37,6 +37,6 @@ void ArucoVideoWidget::update_and_repaint() } } auto qframe2 = qframe.scaled(size(), Qt::IgnoreAspectRatio, Qt::FastTransformation); - pixmap = QPixmap::fromImage(qframe2); + texture = qframe2; update(); } diff --git a/ftnoir_tracker_aruco/ar_video_widget.h b/ftnoir_tracker_aruco/ar_video_widget.h index b95d1873..e2cf4d9f 100644 --- a/ftnoir_tracker_aruco/ar_video_widget.h +++ b/ftnoir_tracker_aruco/ar_video_widget.h @@ -33,13 +33,13 @@ protected slots: void paintEvent( QPaintEvent* e ) { QMutexLocker foo(&mtx); QPainter painter(this); - painter.drawPixmap(e->rect(), pixmap, e->rect()); + painter.drawImage(e->rect(), texture); } void update_and_repaint(); private: QMutex mtx; - QPixmap pixmap; + QImage texture; QTimer timer; cv::Mat _frame; }; -- cgit v1.2.3