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);
        }
Beispiel #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);

            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);
        }
        public bool UnPack(byte[] pack)
        {
            if (pack == null || pack.Length < 32)
            {
                return(false);
            }
            int ptr = 0;

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

            LocationX = BytePacketReader.ReadInt(pack, ref ptr);
            LocationY = BytePacketReader.ReadInt(pack, ref ptr);

            PBSizeX = BytePacketReader.ReadInt(pack, ref ptr);
            PBSizeY = BytePacketReader.ReadInt(pack, ref ptr);

            if (pack.Length == ptr)
            {
                return(true);
            }

            byte[] imageBP = BytePacketReader.ReadPacket(pack, ref ptr);
            using (MemoryStream str = new MemoryStream(imageBP))
            {
                PBImage = Image.FromStream(str);
            }
            return(true);
        }
        public bool UnPack(byte[] pack)
        {
            if (pack == null || pack.Length < 24)
            {
                return(false);
            }
            int ptr = 0;

            _commandID   = BytePacketReader.ReadLong(pack, ref ptr);
            _cliendID    = BytePacketReader.ReadLong(pack, ref ptr);
            PictureBoxID = BytePacketReader.ReadLong(pack, ref ptr);
            return(true);
        }
Beispiel #5
0
        public bool UnPack(byte[] pack)
        {
            if (pack == null || pack.Length < 16)
            {
                return(false);
            }

            int ptr = 0;

            _commandID = BytePacketReader.ReadLong(pack, ref ptr);
            UniqueID   = BytePacketReader.ReadLong(pack, ref ptr);

            return(true);
        }
Beispiel #6
0
        public bool UnPack(byte[] pack)
        {
            if (pack == null || pack.Length < 40)
            {
                return(false);
            }

            int ptr = 8;

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

            MoveObj           = new MoveObject();
            MoveObj.OffsetX   = BytePacketReader.ReadInt(pack, ref ptr);
            MoveObj.OffsetY   = BytePacketReader.ReadInt(pack, ref ptr);
            MoveObj.LocationX = BytePacketReader.ReadInt(pack, ref ptr);
            MoveObj.LocationY = BytePacketReader.ReadInt(pack, ref ptr);

            return(true);
        }
        public bool UnPack(byte[] pack)
        {
            if (pack == null || pack.Length < 42)
            {
                return(false);
            }
            int ptr = 8;

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

            Selector           = new SelectorObject();
            Selector.LocationX = BytePacketReader.ReadInt(pack, ref ptr);
            Selector.LocationY = BytePacketReader.ReadInt(pack, ref ptr);
            Selector.SizeX     = BytePacketReader.ReadInt(pack, ref ptr);
            Selector.SizeY     = BytePacketReader.ReadInt(pack, ref ptr);
            Selector.CutObject = BytePacketReader.ReadBoolean(pack, ref ptr);
            Selector.NeedCopy  = BytePacketReader.ReadBoolean(pack, ref ptr);

            return(true);
        }