|
@@ -315,15 +315,15 @@ namespace OTSIncAReportGraph.Controls
|
|
|
/// 获取随机的颜色
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public Color GetRandomColor()
|
|
|
- {
|
|
|
- int R = new Random((int)DateTime.Now.Ticks).Next(255);
|
|
|
- int G = new Random((int)DateTime.Now.Ticks).Next(255);
|
|
|
- int B = new Random((int)DateTime.Now.Ticks).Next(255);
|
|
|
- B = (R + G > 400) ? R + G - 400 : B;//0 : 380 - R - G;
|
|
|
- B = (B > 255) ? 255 : B;
|
|
|
- return Color.FromArgb(R, G, B);
|
|
|
- }
|
|
|
+ //public Color GetRandomColor()
|
|
|
+ //{
|
|
|
+ // int R = new Random((int)DateTime.Now.Ticks).Next(255);
|
|
|
+ // int G = new Random((int)DateTime.Now.Ticks).Next(255);
|
|
|
+ // int B = new Random((int)DateTime.Now.Ticks).Next(255);
|
|
|
+ // B = (R + G > 400) ? R + G - 400 : B;//0 : 380 - R - G;
|
|
|
+ // B = (B > 255) ? 255 : B;
|
|
|
+ // return Color.FromArgb(R, G, B);
|
|
|
+ //}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 随机获取一个多边形
|
|
@@ -333,36 +333,36 @@ namespace OTSIncAReportGraph.Controls
|
|
|
/// <param name="width"></param>
|
|
|
/// <param name="height"></param>
|
|
|
/// <returns></returns>
|
|
|
- public DisplayParticle GetRondemDParticle(int x, int y, int width, int height, int r)
|
|
|
- {
|
|
|
- DisplayParticle ls_dp = new DisplayParticle();
|
|
|
-
|
|
|
- for (int i = 0; i < height; i++)
|
|
|
- {
|
|
|
- DisplaySegment ls_ds = new DisplaySegment();
|
|
|
- ls_ds.Color = GetRandomColor();
|
|
|
- //随机生成x坐标偏移,和宽度
|
|
|
- Random rd = new Random((int)DateTime.Now.Ticks);
|
|
|
- int a = rd.Next(1);
|
|
|
- if (a == 0)
|
|
|
- {
|
|
|
- int n = rd.Next(r);
|
|
|
- x = x + n;
|
|
|
- width = width + n;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- int n = rd.Next(r);
|
|
|
- x = -+n;
|
|
|
- width = width - n;
|
|
|
- }
|
|
|
-
|
|
|
- ls_ds.SetShowRect(new Rectangle(x, y + i, width, 1));//高度是1的线段
|
|
|
- ls_dp.GetDSegments().Add(ls_ds);
|
|
|
- }
|
|
|
-
|
|
|
- return ls_dp;
|
|
|
- }
|
|
|
+ //public DisplayParticle GetRondemDParticle(int x, int y, int width, int height, int r)
|
|
|
+ //{
|
|
|
+ // DisplayParticle ls_dp = new DisplayParticle();
|
|
|
+
|
|
|
+ // for (int i = 0; i < height; i++)
|
|
|
+ // {
|
|
|
+ // DisplaySegment ls_ds = new DisplaySegment();
|
|
|
+ // ls_ds.Color = GetRandomColor();
|
|
|
+ // //随机生成x坐标偏移,和宽度
|
|
|
+ // Random rd = new Random((int)DateTime.Now.Ticks);
|
|
|
+ // int a = rd.Next(1);
|
|
|
+ // if (a == 0)
|
|
|
+ // {
|
|
|
+ // int n = rd.Next(r);
|
|
|
+ // x = x + n;
|
|
|
+ // width = width + n;
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // int n = rd.Next(r);
|
|
|
+ // x = -+n;
|
|
|
+ // width = width - n;
|
|
|
+ // }
|
|
|
+
|
|
|
+ // ls_ds.SetShowRect(new Rectangle(x, y + i, width, 1));//高度是1的线段
|
|
|
+ // ls_dp.GetDSegments().Add(ls_ds);
|
|
|
+ // }
|
|
|
+
|
|
|
+ // return ls_dp;
|
|
|
+ //}
|
|
|
#endregion
|
|
|
|
|
|
#region 设置双缓冲
|