コード例 #1
0
ファイル: RfbProto.cs プロジェクト: marcin1990/dotnetvnc
 public HexSubRectMsg(byte[] msg, UInt32 offset, byte bytesPp, bool subRectsColored, UInt32 fgPixel) : base()
 {
     pixel       = subRectsColored? RfbProtoUtil.GetPixelFromData(msg, offset, bytesPp) : fgPixel;
     offset      = subRectsColored? offset + bytesPp : offset;
     rect.X      = (UInt16)((msg[offset] & 0xF0) >> 4);
     rect.Y      = (UInt16)(msg[offset] & 0x0F);
     rect.Width  = (UInt16)(((msg[offset + 1] & 0xF0) >> 4) + 1);
     rect.Height = (UInt16)((msg[offset + 1] & 0x0F) + 1);
 }
コード例 #2
0
 public RreSubRectMsg(byte[] msg, byte bytesPp, bool isCompact)
 {
     pixel = RfbProtoUtil.GetPixelFromData(msg, 0, bytesPp);
     if (isCompact)
     {
         rect.X      = msg[bytesPp];
         rect.Y      = msg[bytesPp + 1];
         rect.Width  = msg[bytesPp + 2];
         rect.Height = msg[bytesPp + 3];
     }
     else
     {
         rect.X      = (UInt16)((UInt16)msg[bytesPp] << 8 | (UInt16)msg[bytesPp + 1]);
         rect.Y      = (UInt16)((UInt16)msg[bytesPp + 2] << 8 | (UInt16)msg[bytesPp + 3]);
         rect.Width  = (UInt16)((UInt16)msg[bytesPp + 4] << 8 | (UInt16)msg[bytesPp + 5]);
         rect.Height = (UInt16)((UInt16)msg[bytesPp + 6] << 8 | (UInt16)msg[bytesPp + 7]);
     }
 }