Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of a DMI File.
        /// </summary>
        /// <param name="stream">The Stream containing the DMI file data.</param>
        public DMIFile(Stream stream)
        {
            if (stream is null)
            {
                throw new ArgumentNullException(nameof(stream));
            }

            // As the metadata is embedded in the PNG file, extract into a usable object.
            Metadata = new DMIMetadata(stream);

            // Reset stream position for processing image data.
            stream.Seek(0, SeekOrigin.Begin);
            _states = GetStates(stream).ToList();

            stream.Dispose();
        }
Ejemplo n.º 2
0
 public DMIFile(int frameWidth, int frameHeight)
 {
     Metadata = new DMIMetadata(4.0, frameWidth, frameHeight);
     _states  = new List <DMIState>();
 }