/// <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, ReadingDirection); addBlock(block); return(block); }
/// <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, ReadingDirection); addBlock(block); return(block); }