Exemplo n.º 1
0
 public MovedImageFragment(IDataStream s)
 {
     bounds.X      = s.ReadInt16();
     bounds.Y      = s.ReadInt16();
     bounds.Width  = s.ReadUInt16();
     bounds.Height = s.ReadUInt16();
     source.X      = s.ReadInt16();
     source.Y      = s.ReadInt16();
 }
Exemplo n.º 2
0
        /// <summary>
        /// Reads a DirtyImageFragment from the stream, assuming it is already in compressed format.
        /// </summary>
        /// <param name="s"></param>
        public DirtyImageFragment(IDataStream s)
        {
            bounds.X      = s.ReadInt16();
            bounds.Y      = s.ReadInt16();
            bounds.Width  = s.ReadUInt16();
            bounds.Height = s.ReadUInt16();
            int imgLength = s.ReadInt32();

            screenshot = new Screenshot(bounds.Width, bounds.Height, 32, new byte[imgLength], bufferIsCompressed: true);
            s.Read(screenshot.Buffer, 0, imgLength);
        }
Exemplo n.º 3
0
        public DesktopScreen(IDataStream s)
        {
            adapterIndex = (byte)s.ReadByte();
            outputIndex  = (byte)s.ReadByte();

            ushort strLength = s.ReadUInt16();

            adapterName = Encoding.UTF8.GetString(ByteUtil.ReadNBytes(s, strLength));

            strLength  = s.ReadUInt16();
            outputName = Encoding.UTF8.GetString(ByteUtil.ReadNBytes(s, strLength));

            X      = s.ReadInt16();
            Y      = s.ReadInt16();
            Width  = s.ReadUInt16();
            Height = s.ReadUInt16();
        }
Exemplo n.º 4
0
        public FragmentedImage(IDataStream s)
        {
            streamId = (byte)s.ReadByte();

            List <MovedImageFragment> moveList = new List <MovedImageFragment>();
            List <DirtyImageFragment> dirtList = new List <DirtyImageFragment>();

            ushort moveFragCount  = s.ReadUInt16();
            ushort dirtyFragCount = s.ReadUInt16();

            for (int i = 0; i < moveFragCount; i++)
            {
                moveList.Add(new MovedImageFragment(s));
            }
            for (int i = 0; i < dirtyFragCount; i++)
            {
                dirtList.Add(new DirtyImageFragment(s));
            }

            movedFragments = moveList.ToArray();
            dirtyFragments = dirtList.ToArray();
        }