Пример #1
0
 /// <summary>
 /// 创建一个水印图
 /// </summary>
 /// <param name="mark">水印对象</param>
 /// <param name="savestream">要保存至的文件流</param>
 /// <exception cref="AooshiException">Create Error</exception>
 public void CreateMark(ImageMark mark, Stream savestream)
 {
     if (!mark.Create(this.stream, savestream))
     {
         throw new AooshiException("Create Image Mark Error " + mark.ErrorMessage);
     }
 }
Пример #2
0
 /// <summary>
 /// 创建一个水印图
 /// </summary>
 /// <param name="mark">水印对象</param>
 /// <param name="savepath">要保存至的文件路径</param>
 /// <exception cref="AooshiException">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 AooshiException("Create Image Mark Error " + mark.ErrorMessage);
         }
     }
 }
Пример #3
0
        /// <summary>
        /// 创建一个水印图
        /// </summary>
        /// <param name="mark">水印对象</param>
        /// <exception cref="AooshiException">Create Error</exception>
        public void CreateMark(ImageMark mark)
        {
            MemoryStream ms = new MemoryStream();

            if (!mark.Create(this.stream, ms))
            {
                throw new AooshiException("Create Image Mark Error " + mark.ErrorMessage);
            }
            this.stream.Dispose();
            this.stream = ms;
        }