本文整理汇总了C#中System.Windows.Shapes.Ellipse.MoveNext方法的典型用法代码示例。如果您正苦于以下问题:C# Ellipse.MoveNext方法的具体用法?C# Ellipse.MoveNext怎么用?C# Ellipse.MoveNext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Shapes.Ellipse
的用法示例。
在下文中一共展示了Ellipse.MoveNext方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Window_Loaded
//.........这里部分代码省略.........
colors[i / COLOR_NUM_PER_SEGMENT].Add(cp);
Ellipse e = new Ellipse();
e.Fill = new SolidColorBrush(c);
e.Height = 16;
e.Width = 16;
#if DISP_ASTAR_LSTAR
// a*L*平面
var pos = new Thickness((lab.a) * 10 + originOffsetX, (-lab.L) * 10 + originOffsetY, 0, 0);
#else
// a*b*平面
var pos = new Thickness((lab.a) * 10 + originOffsetX, (-lab.b) * 10 + originOffsetY, 0, 0);
#endif
e.Margin = pos;
canvas1.Children.Add(e);
Canvas.SetZIndex(e, -1);
bool collision = false;
int hashValue = r * 65536 + g * 256 + b;
if (rgbHash.Contains(hashValue)) {
collision = true;
}
rgbHash.Add(hashValue);
Label l = new Label();
l.Content = string.Format("{0}", i + 1);
l.FontSize = 8;
l.Foreground = new SolidColorBrush(Colors.White);
l.Margin = pos;
if (collision) {
l.Margin = new Thickness(pos.Left, pos.Top + l.FontSize, pos.Right, pos.Bottom);
}
canvas1.Children.Add(l);
}
for (int segment = 0; segment < SEGMENT_NUM; ++segment) {
for (int i = 0; i < COLOR_NUM_PER_SEGMENT; ++i) {
var cpFrom = colors[segment].ElementAt(i);
var cpSort = new Dictionary<float, ColorPatch>();
for (int j = 0; j < COLOR_NUM_PER_SEGMENT; ++j) {
if (i == j) {
continue;
}
var cpTo = colors[segment].ElementAt(j);
cpSort.Add(cpFrom.lab.DistanceSquared(cpTo.lab), cpTo);
}
var sorted = (from entry in cpSort orderby entry.Key ascending select entry).ToDictionary(pair => pair.Key, pair => pair.Value);
var e = sorted.GetEnumerator();
e.MoveNext();
cpFrom.neighbor = e.Current.Value;
e.MoveNext();
cpFrom.neighbor2 = e.Current.Value;
e.MoveNext();
cpFrom.neighbor3 = e.Current.Value;
}
}
Console.WriteLine("graph g {");
Console.WriteLine(" graph [bgcolor=\"#484848\"]");
Console.WriteLine(" node [style=filled, fontsize=32, fontcolor=white]");
Console.WriteLine(" edge [fontsize=32, fontcolor=white]");
Console.WriteLine(" rankdir=LR;");
for (int segment = 0; segment < SEGMENT_NUM; ++segment) {
Console.WriteLine(" subgraph cluster{0} {{", segment);
Console.WriteLine(" style=invis;");
for (int i = 0; i < COLOR_NUM_PER_SEGMENT; ++i) {
var cp = colors[segment].ElementAt(i);
string shape = "color=\"#484848\", shape=ellipse";
if (i == 0 || i == COLOR_NUM_PER_SEGMENT - 1) {
shape = ", color=white, shape=doublecircle";
}
Console.WriteLine(" {4} [fillcolor=\"#{0:x2}{1:x2}{2:x2}\"{3}];",
(int)(cp.rgb.r),
(int)(cp.rgb.g),
(int)(cp.rgb.b),
shape,
cp.id + 1); //< ★★★★★ 要注意 1足して表示 ★★★★★
}
for (int i = 0; i < COLOR_NUM_PER_SEGMENT; ++i) {
var cp = colors[segment].ElementAt(i);
WriteLink(segment * COLOR_NUM_PER_SEGMENT, colors[segment], cp.id, cp.neighbor.id, "style=bold, ");
WriteLink(segment * COLOR_NUM_PER_SEGMENT, colors[segment], cp.id, cp.neighbor2.id, " ");
WriteLink(segment * COLOR_NUM_PER_SEGMENT, colors[segment], cp.id, cp.neighbor3.id, "style=dotted,");
}
Console.WriteLine(" }");
}
Console.WriteLine("}");
}