Пример #1
0
 /// <summary>
 /// 创建水印上下文实例(文本水印)
 /// </summary>
 /// <param name="text">文本水印</param>
 /// <param name="location">水印位置,默认为下-右</param>
 public ImageWaterMarkContext(string text, ImageWaterMarkLocation location = ImageWaterMarkLocation.BottomRight)
     : this(location) {
     if (string.IsNullOrEmpty(text))
     {
         throw new ArgumentNullException("text", "文本水印内容不能为null或“”。");
     }
     Text = text;
 }
Пример #2
0
 /// <summary>
 /// 创建水印上下文实例(图像水印)
 /// </summary>
 /// <param name="image">图像水印</param>
 /// <param name="location">水印位置,默认为下-右</param>
 public ImageWaterMarkContext(Bitmap image, ImageWaterMarkLocation location = ImageWaterMarkLocation.BottomRight)
     : this(location) {
     if (image == null)
     {
         throw new ArgumentNullException("image", "图像水印不能为null。");
     }
     Image = image;
 }
Пример #3
0
 private ImageWaterMarkContext(ImageWaterMarkLocation location)
 {
     Location        = location;
     Margin          = DefaultMargin;
     TextFont        = DefaultTextFont;
     TextBackColor   = TextBackColor;
     TextForeColor   = DefaultTextForeColor;
     TextBorderColor = DefaultBorderColor;
     Opacity         = 0.51F;
 }