Example #1
0
 /// <summary>
 /// 创建一个水印图
 /// </summary>
 /// <param name="mark">水印对象</param>
 /// <param name="savestream">要保存至的文件流</param>
 /// <exception cref="ApplicationException">Create Error</exception>
 public void CreateMark(ImageMark mark, Stream savestream)
 {
     if (!mark.Create(this.stream, savestream))
     {
         throw new ApplicationException(string.Concat("Create Imagemark Error ", mark.ErrorMessage));
     }
 }
Example #2
0
 /// <summary>
 /// 创建一个水印图
 /// </summary>
 /// <param name="mark">水印对象</param>
 /// <param name="savepath">要保存至的文件路径</param>
 /// <exception cref="ApplicationException">Create Error</exception>
 public void CreateMark(ImageMark mark, string savepath)
 {
     using (FileStream fs = new FileStream(savepath, FileMode.Create))
     {
         if (!mark.Create(this.stream, fs))
         {
             throw new ApplicationException(string.Concat("Create Imagemark Error ", mark.ErrorMessage));
         }
     }
 }
Example #3
0
        /// <summary>
        /// 创建一个水印图
        /// </summary>
        /// <param name="mark">水印对象</param>
        /// <exception cref="ApplicationException">Create Error</exception>
        public void CreateMark(ImageMark mark)
        {
            MemoryStream ms = new MemoryStream();

            if (!mark.Create(this.stream, ms))
            {
                throw new ApplicationException(string.Concat("Create Imagemark Error ", mark.ErrorMessage));
            }
            this.stream.Dispose();
            this.stream = ms;
        }