Changeset View
Changeset View
Standalone View
Standalone View
vnc/vncclientthread.cpp
| Show First 20 Lines • Show All 184 Lines • ▼ Show 20 Line(s) | |||||
| 185 | void VncClientThread::updatefb(int x, int y, int w, int h) | 185 | void VncClientThread::updatefb(int x, int y, int w, int h) | ||
| 186 | { | 186 | { | ||
| 187 | // qCDebug(KRDC) << "updated client: x: " << x << ", y: " << y << ", w: " << w << ", h: " << h; | 187 | // qCDebug(KRDC) << "updated client: x: " << x << ", y: " << y << ", w: " << w << ", h: " << h; | ||
| 188 | 188 | | |||
| 189 | const int width = cl->width, height = cl->height; | 189 | const int width = cl->width, height = cl->height; | ||
| 190 | QImage img; | 190 | QImage img; | ||
| 191 | switch(colorDepth()) { | 191 | switch(colorDepth()) { | ||
| 192 | case bpp8: | 192 | case bpp8: | ||
| 193 | img = QImage(cl->frameBuffer, width, height, QImage::Format_Indexed8); | 193 | img = QImage(cl->frameBuffer, width, height, width, QImage::Format_Indexed8); | ||
| 194 | img.setColorTable(m_colorTable); | 194 | img.setColorTable(m_colorTable); | ||
| 195 | break; | 195 | break; | ||
| 196 | case bpp16: | 196 | case bpp16: | ||
| 197 | img = QImage(cl->frameBuffer, width, height, QImage::Format_RGB16); | 197 | img = QImage(cl->frameBuffer, width, height, 2*width, QImage::Format_RGB16); | ||
| 198 | break; | 198 | break; | ||
| 199 | case bpp32: | 199 | case bpp32: | ||
| 200 | img = QImage(cl->frameBuffer, width, height, QImage::Format_RGB32); | 200 | img = QImage(cl->frameBuffer, width, height, 4*width, QImage::Format_RGB32); | ||
| 201 | break; | 201 | break; | ||
| 202 | } | 202 | } | ||
| 203 | 203 | | |||
| 204 | if (img.isNull()) { | 204 | if (img.isNull()) { | ||
| 205 | qCDebug(KRDC) << "image not loaded"; | 205 | qCDebug(KRDC) << "image not loaded"; | ||
| 206 | } | 206 | } | ||
| 207 | 207 | | |||
| 208 | if (m_stopped) { | 208 | if (m_stopped) { | ||
| ▲ Show 20 Lines • Show All 469 Lines • Show Last 20 Lines | |||||