void DialogVideoPlayer::paintBackgroundImage(){ if (currentSegment <= 0 || currentSegment > (int)segmentsM.n_rows || segmentsM.is_empty()) { clearBackgroundImage(); return; } QString id = QString((int)segmentsM(currentSegment - 1, SEGCOL_ID)); qDebug() << "paitning: " << id; // Find the correct id if (pathsImages.contains(id)) { QString path = pathsImages.value(id).toString(); qDebug() << "Paitning at path " << path; QPixmap pixmap = QPixmap(path); QSize size(display_width , display_height); pixmap = pixmap.scaled(size); backgroundImageItem->setPixmap(pixmap); } else { clearBackgroundImage(); } }
void ImageEditorScene::setBackgroundImage(QString path) { clearBackgroundImage(); QPixmap pixmap(path); m_background_path = path; m_background_image = addPixmap(pixmap); m_background_image->setZValue(1); }
void CSharedPainterScene::drawBackgroundImage( boost::shared_ptr<CBackgroundImageItem> image ) { backgroundImageItem_ = image; if( image ) { backgroundPixmap_ = image->createPixmap(); int newSceneW = sceneRect().width(); int newSceneH = sceneRect().height(); QSize size = backgroundPixmap_.size(); if( newSceneW < size.width() ) newSceneW = size.width(); if( newSceneH < size.height() ) newSceneH = size.height(); setSceneRect( 0, 0, newSceneW, newSceneH ); } else { clearBackgroundImage(); return; } resetBackground( sceneRect () ); }
void DialogVideoPlayer::changeMovieMode() { stopPlaying(); if (!ui->checkBoxMovie->isChecked()) { paintBackgroundImage(); ui->labelTimeOffset->setEnabled(false); ui->spinBoxTimeOffset->setEnabled(false); } else { clearBackgroundImage(); ui->labelTimeOffset->setEnabled(true); ui->spinBoxTimeOffset->setEnabled(true); } }