Пример #1
0
 public static void DrawNoteBase(this Graphics g, RectangleF rect, GradientColor colors)
 {
     using (var path = rect.ToRoundedPath(rect.Height * 0.3f))
     {
         using (var brush = new LinearGradientBrush(rect, colors.DarkColor, colors.LightColor, LinearGradientMode.Vertical))
         {
             g.FillPath(brush, path);
         }
     }
 }
Пример #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.3f))
                    {
                        g.DrawPath(pen, path);
                    }
                }
            }
        }
Пример #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);
                }
            }
        }
Пример #4
0
 public static void DrawNote(this Graphics g, RectangleF rect, GradientColor foregroundColors, GradientColor borderColors)
 {
     DrawNoteBase(g, rect, foregroundColors);
     DrawBorder(g, rect, borderColors);
 }
Пример #5
0
 public static void DrawTappableNote(this Graphics g, RectangleF rect, GradientColor foregroundColors, GradientColor borderColors)
 {
     g.DrawNote(rect, foregroundColors, borderColors);
     g.DrawTapSymbol(rect);
 }