This repository was archived by the owner on Jul 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRenderSettings.cs
92 lines (84 loc) · 2.14 KB
/
RenderSettings.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
using System.Drawing;
namespace BrushFilter
{
/// <summary>
/// Contains information to be passed from the dialog for rendering.
/// </summary>
static class RenderSettings
{
#region Fields
//The bitmap to render as the final product.
private static Bitmap bmpToRender;
//Whether or not to save settings for the dialog.
private static bool doApplyEffect;
/// <summary>
/// True if the effect has been applied. Prevents re-rendering.
/// </summary>
private static bool effectApplied;
#endregion
#region Properties
/// <summary>
/// The bitmap to render as the final product.
/// </summary>
public static Bitmap BmpToRender
{
get
{
return bmpToRender;
}
set
{
bmpToRender = value;
}
}
/// <summary>
/// Whether to save dialog settings.
/// </summary>
public static bool DoApplyEffect
{
get
{
return doApplyEffect;
}
set
{
doApplyEffect = value;
}
}
/// <summary>
/// True if the effect has been applied. Prevents re-rendering.
/// </summary>
public static bool EffectApplied
{
get
{
return effectApplied;
}
set
{
effectApplied = value;
}
}
#endregion
#region Constructors
/// <summary>
/// Sets the bitmap so it can be locked when used by classes.
/// </summary>
static RenderSettings()
{
Clear();
}
#endregion
#region Methods
/// <summary>
/// Resets all static variables to their defaults.
/// </summary>
public static void Clear()
{
BmpToRender = new Bitmap(1, 1);
doApplyEffect = false;
effectApplied = false;
}
#endregion
}
}