本文整理汇总了C#中Line.Add方法的典型用法代码示例。如果您正苦于以下问题:C# Line.Add方法的具体用法?C# Line.Add怎么用?C# Line.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Line
的用法示例。
在下文中一共展示了Line.Add方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnTick
public override void OnTick()
{
if (!Manager.IsInGame)
return;
var greenCircle = new Circle(CIRCLE_RADIUS, Color.FromArgb(0x8f, 0, 0xff, 0), Color.FromArgb(0x8f, 0, 0xff, 0));
var redCircle = new Circle(CIRCLE_RADIUS, Color.FromArgb(0x8f, 0xff, 0, 0), Color.FromArgb(0x8f, 0xff, 0, 0));
var blueCircle = new Circle(CIRCLE_RADIUS, Color.Black, Color.FromArgb(0x8f, 0, 0, 0xff), isFilled: false);
var units = Manager.Objects.Where(x => x.IsValid && (x.IsUnit || x.IsPlayer)).OfType<WoWUnit>();
foreach (var u in units)
{
if (u.IsNeutral || u.IsHostile)
redCircle.Add(u.Location.ToVector3());
else
greenCircle.Add(u.Location.ToVector3());
blueCircle.Add(u.Location.ToVector3());
var color = (u.InLoS ? Color.FromArgb(0x8f, 0, 0xff, 0) : Color.FromArgb(0x8f, 0xff, 0, 0));
var line = new Line();
line.Add(Manager.LocalPlayer.Location, color);
line.Add(u.Location, color);
Rendering.RegisterResource(line);
}
Rendering.RegisterResource(redCircle);
Rendering.RegisterResource(greenCircle);
Rendering.RegisterResource(blueCircle);
}
示例2: DoCreateChartImage
protected override Image DoCreateChartImage()
{
var chart = new Chart();
var seria = new Line(chart);
foreach (var point in Parameters.SeriaData)
seria.Add(point.Key, point.Value);
chart.Series.Add(seria);
return chart.Bitmap(Parameters.ChartWidth, Parameters.ChartHeight);
}
示例3: AddDataToChart
private void AddDataToChart(QueryResult ChartData, Line line, Line avg, Line lower, Line upper, object AlternameAvgValue)
{
double Value;
DateTime Date;
foreach (DataRow row in ChartData.Rows)
{
if (!DateTime.TryParse(row["Date"].ToString(), out Date))
continue;
if (line != null)
{
if (double.TryParse(row["Value"].ToString(), out Value))
line.Add(Date, Value);
else if (line.Count != 0)
line.Add(Date, line.YValues[line.Count - 1], Color.Transparent);
}
if (avg != null && ShowAverage && ChartData.Columns.Contains("Average"))
{
if (AlternameAvgValue != null && double.TryParse(AlternameAvgValue.ToString(), out Value))
avg.Add(Date, Value);
else if (double.TryParse(row["Average"].ToString(), out Value))
avg.Add(Date, Value);
}
if (lower != null && double.TryParse(row["Min"].ToString(), out Value))
lower.Add(Date, Value);
if (upper != null && double.TryParse(row["Max"].ToString(), out Value))
upper.Add(Date, Value);
}
}