Example #1
0
        public ResolutionInfo(ImageResource imgRes)
            : base(imgRes)
        {
            BinaryReverseReader reader = imgRes.DataReader;

            this.m_hRes      = reader.ReadInt16();
            this.m_hResUnit  = (ResUnit)reader.ReadInt32();
            this.m_widthUnit = (Unit)reader.ReadInt16();

            this.m_vRes       = reader.ReadInt16();
            this.m_vResUnit   = (ResUnit)reader.ReadInt32();
            this.m_heightUnit = (Unit)reader.ReadInt16();

            reader.Close();
        }
Example #2
0
        public AlphaChannels(ImageResource imgRes)
            : base(imgRes)
        {
            BinaryReverseReader reader = imgRes.DataReader;

            // the names are pascal strings without padding!!!
            while ((reader.BaseStream.Length - reader.BaseStream.Position) > 0)
            {
                byte   stringLength = reader.ReadByte();
                string s            = new string(reader.ReadChars(stringLength));
                if (s.Length > 0)
                {
                    m_channelNames.Add(s);
                }
            }
            reader.Close();
        }