diff options
author | Constantin Kaplinsky <const@tightvnc.com> | 2002-05-20 13:10:44 +0000 |
---|---|---|
committer | Constantin Kaplinsky <const@tightvnc.com> | 2002-05-20 13:10:44 +0000 |
commit | 2258f12177ce539ff8162553821d97c8a5523f5a (patch) | |
tree | 8e136a804b6555c96d28e5b7b8962147849d8e25 | |
parent | a5fcd984ef3eb3b9b79482ac1f34ddc7286cd433 (diff) | |
download | tigervnc-2258f12177ce539ff8162553821d97c8a5523f5a.tar.gz tigervnc-2258f12177ce539ff8162553821d97c8a5523f5a.zip |
Fixed pixel format to make it compatible with VNC Reflector, for
RRE and CoRRE encodings.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2503 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r-- | java/src/com/tightvnc/rfbplayer/VncCanvas.java | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/java/src/com/tightvnc/rfbplayer/VncCanvas.java b/java/src/com/tightvnc/rfbplayer/VncCanvas.java index 76ee6b98..2fe0f476 100644 --- a/java/src/com/tightvnc/rfbplayer/VncCanvas.java +++ b/java/src/com/tightvnc/rfbplayer/VncCanvas.java @@ -276,18 +276,25 @@ class VncCanvas extends Canvas { case RfbProto.EncodingRRE: { + byte[] buf = new byte[4]; + int rx = rfb.updateRectX, ry = rfb.updateRectY; int rw = rfb.updateRectW, rh = rfb.updateRectH; int nSubrects = rfb.is.readInt(); int x, y, w, h; - Color pixel; - pixel = new Color(0xFF000000 | rfb.is.readInt()); + rfb.is.readFully(buf); + Color pixel = new Color((buf[2] & 0xFF) << 16 | + (buf[1] & 0xFF) << 8 | + (buf[0] & 0xFF)); memGraphics.setColor(pixel); memGraphics.fillRect(rx, ry, rw, rh); for (int j = 0; j < nSubrects; j++) { - pixel = new Color(0xFF000000 | rfb.is.readInt()); + rfb.is.readFully(buf); + pixel = new Color((buf[2] & 0xFF) << 16 | + (buf[1] & 0xFF) << 8 | + (buf[0] & 0xFF)); x = rx + rfb.is.readUnsignedShort(); y = ry + rfb.is.readUnsignedShort(); w = rfb.is.readUnsignedShort(); @@ -303,18 +310,25 @@ class VncCanvas extends Canvas { case RfbProto.EncodingCoRRE: { + byte[] buf = new byte[4]; + int rx = rfb.updateRectX, ry = rfb.updateRectY; int rw = rfb.updateRectW, rh = rfb.updateRectH; int nSubrects = rfb.is.readInt(); int x, y, w, h; - Color pixel; - pixel = new Color(0xFF000000 | rfb.is.readInt()); + rfb.is.readFully(buf); + Color pixel = new Color((buf[2] & 0xFF) << 16 | + (buf[1] & 0xFF) << 8 | + (buf[0] & 0xFF)); memGraphics.setColor(pixel); memGraphics.fillRect(rx, ry, rw, rh); for (int j = 0; j < nSubrects; j++) { - pixel = new Color(0xFF000000 | rfb.is.readInt()); + rfb.is.readFully(buf); + pixel = new Color((buf[2] & 0xFF) << 16 | + (buf[1] & 0xFF) << 8 | + (buf[0] & 0xFF)); x = rx + rfb.is.readUnsignedByte(); y = ry + rfb.is.readUnsignedByte(); w = rfb.is.readUnsignedByte(); |