コード例 #1
0
 /// <summary>
 ///  Constructs the image/tag combo with the current stream position, the tag, and the image data.
 /// </summary>
 /// <param name="stream">The stream to get the current position from.</param>
 /// <param name="tag">The tag for this image.</param>
 /// <param name="data">The image data for this image.</param>
 /// <param name="id">the optional Id for <see cref="HG3IMG"/> tags.</param>
 public Hg3TagImg(Stream stream, HG3TAG tag, THg3Img data, int id)
 {
     Tag    = tag;
     Data   = data;
     Offset = stream.Position;
     Id     = id;
 }
コード例 #2
0
        /// <summary>
        ///  Adds a new image tag and data to the frame.
        /// </summary>
        /// <param name="stream">The stream to get the current position from.</param>
        /// <param name="tag">The tag for this image.</param>
        /// <param name="data">The image data for this image.</param>
        /// <param name="id">the optional Id for <see cref="HG3IMG"/> tags.</param>
        public void AddTagImg(Stream stream, HG3TAG tag, object data, int id)
        {
            switch (data)
            {
            case HG3IMG img:    Img = new Hg3TagImg <HG3IMG>    (stream, tag, img, id); break;

            case HG3IMG_AL imgAl:  ImgAl = new Hg3TagImg <HG3IMG_AL> (stream, tag, imgAl, id); break;

            case HG3IMG_JPG imgJpg: ImgJpg = new Hg3TagImg <HG3IMG_JPG>(stream, tag, imgJpg, id); break;

            default: throw new ArgumentException(nameof(data));
            }
        }