void RaspiLcdWidget::mouseDoubleClickEvent ( QMouseEvent * /*event*/ )
{
  QClipboard *clip = QApplication::clipboard();
  QPixmap hcop = QPixmap::grabWidget(this);
  hcop.save("xxx.png");
  if( clip ) clip->setPixmap(hcop/*QPixmap::fromImage(m_image).scaled(256,128)*/);
}
bool EditorToolBar::processBase64Image(bool bUseForCopy)
{
    m_strImageSrc.remove(0, 12);
    QString strType = m_strImageSrc.left(m_strImageSrc.indexOf(';'));
    m_strImageSrc.remove(0, m_strImageSrc.indexOf(',') + 1);
    //
    QByteArray baData;
    if (!WizBase64Decode(m_strImageSrc, baData))
        return false;

    //
    QPixmap pix;
    pix.loadFromData(baData, strType.toUtf8());
    if (!bUseForCopy)
    {
        QString strFilePath = QFileDialog::getSaveFileName(this, tr("Save as..."),
                                                           QDir::homePath(), tr("Image Files (*.%1)").arg(strType));
        if (strFilePath.isEmpty())
            return false;

        bool ret = pix.save(strFilePath, strType.toUtf8());
        TOLOG2(_T("[Save] : save image to %1, result : %2"), strFilePath,
               ret ? "OK" : "Failed");    //pix formart should use ascii or capital letter.
    }
    else
    {
        QClipboard* clip = QApplication::clipboard();
        clip->setPixmap(pix);
    }

    return true;
}
Example #3
0
void MainWindow::saveCopy()
{
    if( mLastCapture && !mLastCapture->img()->isNull() )
    {
        QClipboard *cpb = QApplication::clipboard();
        cpb->setPixmap( *mLastCapture->img() );
    }
}
Example #4
0
void PlaylistEdit::on_coverCopyButton_clicked()
{
	QClipboard *clipboard = QApplication::clipboard();
	if (!clipboard) return;
	QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
	clipboard->setPixmap(Cover);
	QApplication::restoreOverrideCursor();
}
void MainWindow::on_actionCopy_Image_triggered()
{
    if (Workspace::Instance.IsImageAvalilable())
    {
        QClipboard *clipboard = QApplication::clipboard();
        QPixmap img = imageLabel->pixmap()->copy();
        clipboard->setPixmap(img);
    }
}
Example #6
0
void ResultsPage::copyPlot()
{
    uncolorCurve(m_selectedRow);
   
    // Set the clilpboard image
    QClipboard * clipboard = QApplication::clipboard();
    clipboard->setPixmap(QPixmap::grabWidget(m_plot));
    
    colorCurve(m_selectedRow);
}
Example #7
0
void PortableTester::clickedPRSCR() {
    
    QPixmap Pix = QPixmap();
    Pix = QPixmap::grabWindow(QApplication::desktop()->winId());
    Pix.save("mainscreen.jpg");
    QClipboard *board = QApplication::clipboard();
    board->setPixmap(Pix);
    QWidget::showFullScreen();
    
}
void smallPictureView::copyFile(){
    if(!allImgs.isEmpty()){
        QPixmap pixmap;
        pixmap.load(allImgs.at(selectedNum).absoluteFilePath());
        QClipboard *clipboard = QApplication::clipboard();
        clipboard->setPixmap(pixmap);
    }else{
        QMessageBox message(QMessageBox::NoIcon, "提示", "请先选择图片文件!");
        message.setIconPixmap(QPixmap("../2.png"));
        message.exec();
    }

}
void EditorToolBar::copyImage(QString strFileName)
{
    QFileInfo info(strFileName);
    QPixmap pix(info.filePath());
    if (pix.isNull())
    {
        TOLOG(_T("[Copy] : image is null"));
        return;
    }

    QClipboard* clip = QApplication::clipboard();
    clip->setPixmap(pix);
}
Example #10
0
void CScreenShotView::onFinishTimerOut()
{
    QPointF startPos = m_selectRectItem->getSelectRect().topLeft();
    QPointF endPos = m_selectRectItem->getSelectRect().bottomRight();
    //    QRect rect = getPositiveRect(startPos,endPos).toRect();
    QRect rect = CScreenshotUtil::convertLineFToRectF(QLineF(startPos,endPos)).toRect();
    if(rect.width() >= 1 && rect.height() >= 1)
    {
        m_isValid = true;
        m_pixmap = createPixmap(rect);
        QClipboard *clipboard = QApplication::clipboard();
        clipboard->setPixmap(m_pixmap);
    }
    else
    {
        m_isValid = false;
    }
    C_SCREENSHOT_LOG_INFO(QString("shot is %1valid,pixmap is %2null")
                           .arg(m_isValid?"":"not")
                           .arg(m_pixmap.isNull()?"":"not "));
    setShotStatus(CSCREEN_SHOT_STATE_FINISHED);
}
Example #11
0
void KSnapshot::slotCopy()
{
    QClipboard *cb = QApplication::clipboard();
    cb->setPixmap( snapshot );
}
Example #12
0
void KMainWindowInterface::grabWindowToClipBoard()
{
    QClipboard *clipboard = QApplication::clipboard();
    clipboard->setPixmap(QPixmap::grabWidget(m_MainWindow));
}
void SnapshotDialog::copyClicked() {
  QPixmap pixmap=view->snapshot(QSize(ui->widthSpinBox->value(),ui->heightSpinBox->value()));

  QClipboard *clipboard = QApplication::clipboard();
  clipboard->setPixmap(pixmap);
}
Example #14
0
void MainWidget::copyImage()
{
    QClipboard *cb = QApplication::clipboard();
    cb->setPixmap(originalPixmap);
    qDebug() << "copied.";
}