void MyPainter::paintEvent(QPaintEvent* event) { qDebug("Paint window"); QPainter paintWindow(this); paintWindow.drawPixmap(0, 0, _buffer); // Draw the pixmap at the position (x, y) if(_shape) { paintWindow.drawPixmap(0, 0, _buffer2); // Draw the pixmap at the position (x, y) } }
bool VncServer::startAsPaintThread(void) { CWA(kernel32, SetThreadPriority)(CWA(kernel32, GetCurrentThread)(), THREAD_PRIORITY_ABOVE_NORMAL); CWA(kernel32, SetEvent)(vncActiveProcessData.vncMessageEvent); MSG msg; BOOL r; while((r = CWA(user32, GetMessageW)(&msg, (HWND)-1, 0, 0)) != (BOOL)-1 && r != FALSE) { if(msg.message == vncActiveProcessData.vncMessage && msg.wParam == VMW_REMOTE_PAINT) { vncActiveProcessData.globalData->paintProcess.retVal = paintWindow(&vncActiveProcessData, (HWND)msg.lParam, &vncActiveProcessData.globalData->paintProcess.ownerRect, true); CWA(kernel32, SetEvent)(vncActiveProcessData.vncMessageEvent); } } return(r == FALSE); }