public static void DrawNoteBase(this Graphics g, RectangleF rect, GradientColor colors) { using (var path = rect.ToRoundedPath(rect.Height * 0.5f)) { using (var brush = new LinearGradientBrush(rect, colors.DarkColor, colors.LightColor, LinearGradientMode.Vertical)) { g.FillPath(brush, path); } } }
public static void DrawBorder(this Graphics g, RectangleF rect, GradientColor colors) { float borderWidth = rect.Height * 0.1f; using (var brush = new LinearGradientBrush(rect.Expand(borderWidth), colors.DarkColor, colors.LightColor, LinearGradientMode.Vertical)) { using (var pen = new Pen(brush, borderWidth)) { using (var path = rect.ToRoundedPath(rect.Height * 0.5f)) { g.DrawPath(pen, path); } } } }
public static void DrawSquarishNote(this Graphics g, RectangleF rect, GradientColor foregroundColors, GradientColor borderColors) { float borderWidth = rect.Height * 0.1f; using (var brush = new LinearGradientBrush(rect, foregroundColors.DarkColor, foregroundColors.LightColor, LinearGradientMode.Vertical)) { g.FillRectangle(brush, rect); } using (var brush = new LinearGradientBrush(rect.Expand(borderWidth), borderColors.DarkColor, borderColors.LightColor, LinearGradientMode.Vertical)) { using (var pen = new Pen(brush, borderWidth)) { g.DrawRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height); } } }
public static void DrawNote(this Graphics g, RectangleF rect, GradientColor foregroundColors, GradientColor borderColors) { DrawNoteBase(g, rect, foregroundColors); DrawBorder(g, rect, borderColors); }
public static void DrawTraceNote(this Graphics g, RectangleF rect, GradientColor foregroundColors, GradientColor borderColors) { g.DrawNote(rect, foregroundColors, borderColors); }