コード例 #1
0
        public Slices(ImageResource imgRes)
            : base(imgRes)
        {
            BinaryPSDReader reader = imgRes.GetDataReader();

            this.Version    = reader.ReadUInt32();
            this.Rectangle  = reader.ReadPSDRectangle(); // new Rectangle(reader).ToERectangle();
            this.SlicesName = reader.ReadPSDUnicodeString();

            int cnt = (int)reader.ReadUInt32();

            this.SliceList = new List <Slice>();
            for (int i = 0; i < cnt; i++)
            {
                this.SliceList.Add(new Slice(reader));
            }

            int    unknown1 = (int)reader.ReadUInt32();
            int    unknown2 = (int)reader.ReadUInt32();
            ushort unknown3 = reader.ReadUInt16();
            string unknown4 = DynVal.ReadSpecialString(reader);
            int    unknown5 = (int)reader.ReadUInt32();

            this.Values = new List <DynVal>();
            while (reader.BytesToEnd > 0)
            {
                DynVal val = DynVal.ReadValue(reader, false);
                this.Values.Add(val);
            }
            //this.Values = DynVal.ReadValues(reader);
            //this.Data = reader.ReadBytes((int)reader.BytesToEnd);
            reader.Close();
        }