* UILedBulb:更新绘制平滑

This commit is contained in:
Sunny 2020-07-11 20:53:40 +08:00
parent abe882329c
commit b39c27753e
6 changed files with 40 additions and 4 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -91,4 +91,34 @@ namespace Sunny.UI
}
}
}
public class UILiveChartStyle:UIChartStyle
{
public override Color BackColor => Color.FromArgb(16, 36, 71);
public override Color ForeColor => Color.FromArgb(170, 170, 170);
public override Color ToolTipShadowColor => Color.FromArgb(81, 81, 81);
public override Color[] SeriesColor
{
get
{
return new[]
{
Color.FromArgb(33, 149, 242),
Color.FromArgb(254, 192, 7),
Color.FromArgb(243, 67, 54),
Color.FromArgb(96, 125, 138),
Color.FromArgb(0,187,211),
Color.FromArgb(232,30,99),
Color.FromArgb(254,87,34),
Color.FromArgb(63,81,180),
Color.FromArgb(204,219,57),
Color.FromArgb(0,149,135),
Color.FromArgb(255,154,59)
};
}
}
}
}

View File

@ -123,7 +123,8 @@ namespace Sunny.UI
{
Default,
Plain,
Dark
Dark,
LiveChart
}
public static class UIChartStyles
@ -134,10 +135,13 @@ namespace Sunny.UI
public static UIChartStyle Dark = new UIDarkChartStyle();
public static UIChartStyle LiveChart = new UILiveChartStyle();
public static UIChartStyle GetChartStyle(UIChartStyleType style)
{
if (style == UIChartStyleType.Default) return Default;
if (style == UIChartStyleType.Dark) return Dark;
if (style == UIChartStyleType.LiveChart) return LiveChart;
return Plain;
}
}

View File

@ -116,7 +116,7 @@ namespace Sunny.UI
Bitmap offScreenBmp = new Bitmap(ClientRectangle.Width, ClientRectangle.Height);
using (var g = Graphics.FromImage(offScreenBmp))
{
g.SmoothingMode = SmoothingMode.HighQuality;
g.SetHighQuality();
// Draw the control
drawControl(g, On);
// Draw the image to the screen
@ -143,7 +143,7 @@ namespace Sunny.UI
// Draw the background ellipse
var rectangle = new Rectangle(Padding.Left, Padding.Top, diameter, diameter);
g.FillEllipse(darkColor, rectangle);
g.FillEllipse(darkColor, rectangle,true);
// Draw the glow gradient
var path = new GraphicsPath();
@ -151,6 +151,7 @@ namespace Sunny.UI
var pathBrush = new PathGradientBrush(path);
pathBrush.CenterColor = lightColor;
pathBrush.SurroundColors = new[] { Color.FromArgb(0, lightColor) };
g.SetHighQuality();
g.FillEllipse(pathBrush, rectangle);
pathBrush.Dispose();
@ -163,6 +164,7 @@ namespace Sunny.UI
var pathBrush1 = new PathGradientBrush(path);
pathBrush1.CenterColor = _reflectionColor;
pathBrush1.SurroundColors = _surroundColor;
g.SetHighQuality();
g.FillEllipse(pathBrush1, whiteRect);
pathBrush1.Dispose();