void UIMachineViewScale::takePauseShotLive() { /* Take a screen snapshot. Note that TakeScreenShot() always needs a 32bpp image: */ QImage shot = QImage(m_pFrameBuffer->width(), m_pFrameBuffer->height(), QImage::Format_RGB32); /* If TakeScreenShot fails or returns no image, just show a black image. */ shot.fill(0); CDisplay dsp = session().GetConsole().GetDisplay(); dsp.TakeScreenShot(screenId(), shot.bits(), shot.width(), shot.height()); m_pPauseImage = new QImage(shot); scalePauseShot(); }
void UIMachineView::takePauseShotLive() { /* Take a screen snapshot. Note that TakeScreenShot() always needs a 32bpp image: */ QImage shot = QImage(m_pFrameBuffer->width(), m_pFrameBuffer->height(), QImage::Format_RGB32); /* If TakeScreenShot fails or returns no image, just show a black image. */ shot.fill(0); CDisplay dsp = session().GetConsole().GetDisplay(); dsp.TakeScreenShot(screenId(), shot.bits(), shot.width(), shot.height()); /* TakeScreenShot() may fail if, e.g. the Paused notification was delivered * after the machine execution was resumed. It's not fatal: */ if (dsp.isOk()) dimImage(shot); m_pauseShot = QPixmap::fromImage(shot); }