Exemple #1
0
 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);
         }
     }
 }
Exemple #2
0
        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);
                    }
                }
            }
        }
Exemple #3
0
        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);
                }
            }
        }
Exemple #4
0
 public static void DrawNote(this Graphics g, RectangleF rect, GradientColor foregroundColors, GradientColor borderColors)
 {
     DrawNoteBase(g, rect, foregroundColors);
     DrawBorder(g, rect, borderColors);
 }
Exemple #5
0
 public static void DrawTraceNote(this Graphics g, RectangleF rect, GradientColor foregroundColors, GradientColor borderColors)
 {
     g.DrawNote(rect, foregroundColors, borderColors);
 }