* UILineChart: 支持FillColor透明

This commit is contained in:
Sunny 2022-01-06 10:54:44 +08:00
parent 0c7a944132
commit 599acadacd
3 changed files with 23 additions and 15 deletions

Binary file not shown.

Binary file not shown.

View File

@ -28,6 +28,7 @@
* 2021-12-31: V3.0.9 线线
* 2021-12-31: V3.0.9
* 2021-12-31: V3.0.9 X轴支持字符串显示
* 2022-01-06: V3.1.0 FillColor透明
******************************************************************************/
using System;
@ -474,20 +475,23 @@ namespace Sunny.UI
{
if (YScale == null) return;
using (Graphics graphics = bmp.Graphics())
{
graphics.FillRectangle(FillColor, 0, 0, Width, Height);
}
bmp?.Dispose();
bmp = new Bitmap(Width, Height);
using (Graphics graphics = bmpGreater.Graphics())
{
graphics.FillRectangle(FillColor, 0, 0, Width, Height);
}
using (Graphics graphics = bmpLess.Graphics())
{
graphics.FillRectangle(FillColor, 0, 0, Width, Height);
}
//using (Graphics graphics = bmp.Graphics())
//{
// graphics.FillRectangle(FillColor, 0, 0, Width, Height);
//}
//
//using (Graphics graphics = bmpGreater.Graphics())
//{
// graphics.FillRectangle(FillColor, 0, 0, Width, Height);
//}
//
//using (Graphics graphics = bmpLess.Graphics())
//{
// graphics.FillRectangle(FillColor, 0, 0, Width, Height);
//}
int idx = 0;
float wTop = Option.Grid.Top;
@ -511,6 +515,12 @@ namespace Sunny.UI
}
else
{
bmpGreater?.Dispose();
bmpGreater = new Bitmap(Width, Height);
bmpLess?.Dispose();
bmpLess = new Bitmap(Width, Height);
foreach (var series in Option.Series.Values)
{
Color color = series.Color;
@ -571,8 +581,6 @@ namespace Sunny.UI
g.DrawImage(bmp, new Rectangle((int)wLeft, (int)wTop, (int)(wRight - wLeft), (int)(wBottom - wTop)),
new Rectangle((int)wLeft, (int)wTop, (int)(wRight - wLeft), (int)(wBottom - wTop)), GraphicsUnit.Pixel);
}
private void DrawPointSymbols(Graphics g)