Example #1
0
        /// <summary>
        /// Add an image to this container from a stream.
        /// </summary>
        /// <param name="imageStream">MemoryStream containing image.</param>
        /// <returns>Image being added.</returns>
        public RtfImage addImage(System.IO.MemoryStream imageStream)
        {
            if (!_allowImage)
            {
                throw new Exception("Image is not allowed.");
            }
            RtfImage block = new RtfImage(imageStream);

            addBlock(block);
            return(block);
        }
Example #2
0
        /// <summary>
        /// Add an image to this container from a file with filetype provided.
        /// </summary>
        /// <param name="imgFname">Filename of the image.</param>
        /// <param name="imgType">File type of the image.</param>
        /// <returns>Image being added.</returns>
        public RtfImage addImage(string imgFname, ImageFileType imgType)
        {
            if (!_allowImage)
            {
                throw new Exception("Image is not allowed.");
            }
            RtfImage block = new RtfImage(imgFname, imgType);

            addBlock(block);
            return(block);
        }