-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathTextWatermarkOptions.cs
69 lines (60 loc) · 2.53 KB
/
TextWatermarkOptions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
using System.Drawing;
namespace LazZiya.ImageResize
{
/// <summary>
/// Define options for adding text watermark over the image, like text color, opacity, text outline, etc.
/// </summary>
public class TextWatermarkOptions
{
/// <summary>
/// Value for the text color. Use alpha channel to specify transparency (0 - 255).
/// Set alpha to 0 to remove text color.
/// Default value Color.FromArgb(255, Color.White) full color.
/// See <see cref="Color"/>
/// </summary>
public Color TextColor { get; set; } = Color.FromArgb(255, Color.White);
/// <summary>
/// Font size in pixel.
/// Default value 24
/// </summary>
public int FontSize { get; set; } = 24;
/// <summary>
/// Font style. Default value FontStyle.Regular.
/// See <see cref="FontStyle"/>
/// </summary>
public FontStyle FontStyle { get; set; } = FontStyle.Regular;
/// <summary>
/// Font family. Default value "Arial"
/// </summary>
public string FontName { get; set; } = "Arial";
/// <summary>
/// Value for the text background color. Use alpha channel to specify transparency (0 - 255).
/// Set alpha to 0 to remove background.
/// Default value Color.FromArgb(0, Color.White) no background.
/// See <see cref="Color"/>
/// </summary>
public Color BGColor { get; set; } = Color.FromArgb(0, Color.White);
/// <summary>
/// Top/Bottom margin in pixels. Depends on watermark horizontal alignment.
/// Default value 10
/// </summary>
public int Margin { get; set; } = 10;
/// <summary>
/// The location to draw the text watermark. Choose from pre-defined 9 main locations (3 cols, 3 rows).
/// Default value TargetSpot.BottomLeft.
/// See <see cref="TargetSpot"/>
/// </summary>
public TargetSpot Location { get; set; } = TargetSpot.BottomLeft;
/// <summary>
/// Value for the text outline color. Use alpha channel to specify transparency (0 - 255).
/// Set alpha to 0 to remove outline.
/// Default value Color.FromArgb(255, Color.Black)
/// See <see cref="Color"/>
/// </summary>
public Color OutlineColor { get; set; } = Color.FromArgb(255, Color.Black);
/// <summary>
/// Text outline width in pixels. Default value 3.5f
/// </summary>
public float OutlineWidth { get; set; } = 3.5f;
}
}