-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathWaveFormRendererSettings.cs
48 lines (43 loc) · 1.54 KB
/
WaveFormRendererSettings.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
using System.Drawing;
using System.Drawing.Drawing2D;
namespace NAudio.WaveFormRenderer
{
public class WaveFormRendererSettings
{
protected WaveFormRendererSettings()
{
Width = 800;
TopHeight = 50;
BottomHeight = 50;
PixelsPerPeak = 1;
SpacerPixels = 0;
BackgroundColor = Color.Beige;
}
// for display purposes only
public string Name { get; set; }
public int Width { get; set; }
public int TopHeight { get; set; }
public int BottomHeight { get; set; }
public int PixelsPerPeak { get; set; }
public int SpacerPixels { get; set; }
public virtual Pen TopPeakPen { get; set; }
public virtual Pen TopSpacerPen { get; set; }
public virtual Pen BottomPeakPen { get; set; }
public virtual Pen BottomSpacerPen { get; set; }
public bool DecibelScale { get; set; }
public Color BackgroundColor { get; set; }
public Image BackgroundImage { get; set; }
public Brush BackgroundBrush {
get
{
if (BackgroundImage == null) return new SolidBrush(BackgroundColor);
return new TextureBrush(BackgroundImage,WrapMode.Clamp);
}
}
protected static Pen CreateGradientPen(int height, Color startColor, Color endColor)
{
var brush = new LinearGradientBrush(new Point(0, 0), new Point(0, height), startColor, endColor);
return new Pen(brush);
}
}
}