Changeset 28246 in vbox
- Timestamp:
- Apr 13, 2010 12:38:08 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r28241 r28246 1222 1222 (state != KMachineState_TeleportingPausedVM || m_previousState != KMachineState_Teleporting)) 1223 1223 { 1224 if (screenId() == 0) 1224 /* Take a screen snapshot. Note that TakeScreenShot() always needs a 32bpp image: */ 1225 QImage shot = QImage(m_pFrameBuffer->width(), m_pFrameBuffer->height(), QImage::Format_RGB32); 1226 /* If TakeScreenShot fails or returns no image, just show a black image. */ 1227 shot.fill(0); 1228 CDisplay dsp = session().GetConsole().GetDisplay(); 1229 dsp.TakeScreenShot(screenId(), shot.bits(), shot.width(), shot.height()); 1230 /* TakeScreenShot() may fail if, e.g. the Paused notification was delivered 1231 * after the machine execution was resumed. It's not fatal: */ 1232 if (dsp.isOk()) 1225 1233 { 1226 /* Take a screen snapshot. Note that TakeScreenShot() always needs a 32bpp image: */ 1227 QImage shot = QImage(m_pFrameBuffer->width(), m_pFrameBuffer->height(), QImage::Format_RGB32); 1228 CDisplay dsp = session().GetConsole().GetDisplay(); 1229 dsp.TakeScreenShot(screenId(), shot.bits(), shot.width(), shot.height()); 1230 /* TakeScreenShot() may fail if, e.g. the Paused notification was delivered 1231 * after the machine execution was resumed. It's not fatal: */ 1232 if (dsp.isOk()) 1233 { 1234 dimImage(shot); 1235 m_pauseShot = QPixmap::fromImage(shot); 1236 /* Fully repaint to pick up m_pauseShot: */ 1237 viewport()->repaint(); 1238 } 1239 }else 1240 { 1241 /* For secondary monitors we support 32 bit formats only for now. */ 1242 if ( m_pFrameBuffer 1243 && m_pFrameBuffer->address() 1244 && m_pFrameBuffer->pixelFormat() == FramebufferPixelFormat_FOURCC_RGB 1245 && m_pFrameBuffer->bitsPerPixel() == 32) 1246 { 1247 /* Make a *real* depth copy out of the current framebuffer content. */ 1248 QImage shot = QImage(m_pFrameBuffer->address(), m_pFrameBuffer->width(), m_pFrameBuffer->height(), QImage::Format_RGB32).copy(); 1249 dimImage(shot); 1250 m_pauseShot = QPixmap::fromImage(shot); 1251 /* Fully repaint to pick up m_pauseShot: */ 1252 viewport()->repaint(); 1253 } 1254 else 1255 { 1256 /* If there is no framebuffer or a unsupported format, just create a black image to show. */ 1257 QImage shot = QImage(m_pFrameBuffer->width(), m_pFrameBuffer->height(), QImage::Format_RGB32); 1258 shot.fill(0); 1259 m_pauseShot = QPixmap::fromImage(shot); 1260 /* Fully repaint to pick up m_pauseShot: */ 1261 viewport()->repaint(); 1262 } 1234 dimImage(shot); 1263 1235 } 1236 m_pauseShot = QPixmap::fromImage(shot); 1237 /* Fully repaint to pick up m_pauseShot: */ 1238 viewport()->repaint(); 1264 1239 } 1265 1240 break;
Note:
See TracChangeset
for help on using the changeset viewer.