Subversion Repositories seema-scanner

Rev

Rev 23 | Rev 99 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 23 Rev 28
Line 40... Line 40...
40
    }
40
    }
41
}
41
}
42
 
42
 
43
 
43
 
44
void SMVideoWidget::showImageCV(cv::Mat image){
44
void SMVideoWidget::showImageCV(cv::Mat image){
45
    //ui->videoWidget->showFrameCV(image);
-
 
46
 
45
 
47
    QImage qimage = cvMat2qImage(image);
46
    QImage qimage = cvMat2qImage(image);
48
 
47
 
-
 
48
    // correct size only if label has no borders/frame!
49
    int w = this->width();
49
    int w = this->width();
50
    int h = this->height();
50
    int h = this->height();
51
    QPixmap pixmap = QPixmap::fromImage(qimage);
-
 
52
 
51
 
-
 
52
    pixmap = QPixmap::fromImage(qimage);
53
    this->setPixmap(pixmap.scaled(w,h,Qt::KeepAspectRatio));
53
    this->setPixmap(pixmap.scaled(w,h,Qt::KeepAspectRatio));
54
 
54
 
55
}
55
}
-
 
56
 
-
 
57
void SMVideoWidget::resizeEvent(QResizeEvent *event){
-
 
58
 
-
 
59
    if(!pixmap.isNull()){
-
 
60
        // correct size only if label has no borders/frame!
-
 
61
        int w = event->size().width();
-
 
62
        int h = event->size().height();
-
 
63
        this->setPixmap(pixmap.scaled(w,h,Qt::KeepAspectRatio));
-
 
64
    }
-
 
65
}