Ejemplo n.º 1
0
        public bool UnPack(byte[] pack)
        {
            if (pack == null || pack.Length < 48)
            {
                return(false);
            }
            int ptr = 8;

            CliendID     = BytePacketReader.ReadLong(pack, ref ptr);
            PictureBoxID = BytePacketReader.ReadLong(pack, ref ptr);

            Rect = new EllipseObject();
            byte cR = BytePacketReader.ReadByte(pack, ref ptr);
            byte cG = BytePacketReader.ReadByte(pack, ref ptr);
            byte cB = BytePacketReader.ReadByte(pack, ref ptr);
            byte cA = BytePacketReader.ReadByte(pack, ref ptr);

            Rect.BrushColor = Color.FromArgb(cA, cR, cG, cB);

            Rect.BrushSize = BytePacketReader.ReadInt(pack, ref ptr);
            Rect.LocationX = BytePacketReader.ReadInt(pack, ref ptr);
            Rect.LocationY = BytePacketReader.ReadInt(pack, ref ptr);
            Rect.SizeX     = BytePacketReader.ReadInt(pack, ref ptr);
            Rect.SizeY     = BytePacketReader.ReadInt(pack, ref ptr);
            return(true);
        }
Ejemplo n.º 2
0
        public bool UnPack(byte[] pack)
        {
            if (pack == null || pack.Length < 48)
            {
                return(false);
            }
            int ptr = 8;

            CliendID     = BytePacketReader.ReadLong(pack, ref ptr);
            PictureBoxID = BytePacketReader.ReadLong(pack, ref ptr);

            Line = new BrushLineObject();

            byte cR = BytePacketReader.ReadByte(pack, ref ptr);
            byte cG = BytePacketReader.ReadByte(pack, ref ptr);
            byte cB = BytePacketReader.ReadByte(pack, ref ptr);
            byte cA = BytePacketReader.ReadByte(pack, ref ptr);

            Line.BrushColor = Color.FromArgb(cA, cR, cG, cB);

            Line.BrushSize  = BytePacketReader.ReadInt(pack, ref ptr);
            Line.LineStartX = BytePacketReader.ReadInt(pack, ref ptr);
            Line.LineStartY = BytePacketReader.ReadInt(pack, ref ptr);
            Line.LineEndX   = BytePacketReader.ReadInt(pack, ref ptr);
            Line.LineEndY   = BytePacketReader.ReadInt(pack, ref ptr);

            return(true);
        }