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 UIMachineViewScale::takePauseShotSnapshot() { CMachine machine = session().GetMachine(); ULONG width = 0, height = 0; QVector<BYTE> screenData = machine.ReadSavedScreenshotPNGToArray(0, width, height); if (screenData.size() != 0) { ULONG guestWidth = 0, guestHeight = 0; machine.QuerySavedGuestSize(0, guestWidth, guestHeight); QImage shot = QImage::fromData(screenData.data(), screenData.size(), "PNG").scaled(guestWidth > 0 ? QSize(guestWidth, guestHeight) : guestSizeHint()); m_pPauseImage = new QImage(shot); scalePauseShot(); } }
void UIMachineViewScale::sltPerformGuestScale() { /* Check if scale is requested: */ /* Set new frame-buffer scale-factor: */ frameBuffer()->setScaledSize(viewport()->size()); /* Scale the pause image if necessary */ scalePauseShot(); /* Update viewport: */ viewport()->repaint(); /* Update machine-view sliders: */ updateSliders(); }