void UBDesktopAnnotationController::customCapture()
{
    mIsFullyTransparent = true;
    updateBackground();

    mDesktopPalette->disappearForCapture();
    UBCustomCaptureWindow customCaptureWindow(mDesktopPalette);

    // need to show the window before execute it to avoid some glitch on windows.

#ifndef Q_WS_WIN // Working only without this call on win32 desktop mode
    customCaptureWindow.show();
#endif

    if (customCaptureWindow.execute(getScreenPixmap()) == QDialog::Accepted)
    {
        QPixmap selectedPixmap = customCaptureWindow.getSelectedPixmap();
        emit imageCaptured(selectedPixmap, false);
    }

    mDesktopPalette->appear();

    mIsFullyTransparent = false;
    updateBackground();
}
示例#2
0
QPixmap CScreenShotView::createDesktopPixmap()
{
#ifdef Q_OS_MAC
    QPixmap pixmap = getScreenPixmap(m_desktopScreen);
#else
    QDesktopWidget *pDesktoWidget = QApplication::desktop();
    QPixmap pixmap = m_desktopScreen->grabWindow(pDesktoWidget->winId(),pDesktoWidget->geometry().x()
                                        ,pDesktoWidget->geometry().y(),pDesktoWidget->geometry().width(),pDesktoWidget->geometry().height());

#endif
    return pixmap;
}
void UBDesktopAnnotationController::screenCapture()
{
    mIsFullyTransparent = true;
    updateBackground();

    mDesktopPalette->disappearForCapture();

    QPixmap originalPixmap = getScreenPixmap();

    mDesktopPalette->appear();

    emit imageCaptured(originalPixmap, false);

    mIsFullyTransparent = false;

    updateBackground();
}