本文整理汇总了C#中System.Windows.Shapes.Ellipse.InvalidateVisual方法的典型用法代码示例。如果您正苦于以下问题:C# Ellipse.InvalidateVisual方法的具体用法?C# Ellipse.InvalidateVisual怎么用?C# Ellipse.InvalidateVisual使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Shapes.Ellipse
的用法示例。
在下文中一共展示了Ellipse.InvalidateVisual方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: timer_Tick
void timer_Tick(object sender, EventArgs e)
{
if (OpenedFrames != null)
{
var frame = OpenedFrames[index];
var frame_old = OpenedFrames[index-1];
double x = frame.X - frame_old.X;
double y = frame.Y - frame_old.Y;
canvas1.Children.Clear();
canvas2.Children.Clear();
Ellipse el = new Ellipse();
el.Width = 10;
el.Height = 10;
el.Fill = new SolidColorBrush(Colors.Green);
Canvas.SetLeft(el, off_x + x / c_max);
Canvas.SetTop(el, off_y + y / c_max);
el.InvalidateVisual();
canvas1.Children.Add(el);
int center = (int)JointType.HipCenter;
var hip = frame.Nodes.FirstOrDefault(o=>o.NodeType==center);
//frame.Nodes.Where(o=>legs_int.Contains(o.NodeType)).Zip(frame_old.Nodes.Where(o=>legs_int.Contains(o.NodeType)), (e1, e2) =>
//{
// SkeletonNode n = new SkeletonNode();
// double deg = Math.PI / 2;
// n.X = (e1.X + e1.Z * Math.Tan(deg)) / Math.Sqrt(1 + Math.Tan(deg) * Math.Tan(deg));
// n.Y = e1.Y ;
// Point a = new Point();
// a.X = e1.X - x;
// a.Y = e1.Y - y;
// //a.X = e1.X - x - hip.X;
// //a.Y = e1.Y - y - hip.Y;
// //rotation
// a.X = n.X - x;
// a.Y = n.Y - y;
// SolidColorBrush b = new SolidColorBrush(Colors.Black);
// if(leg_right.Contains(e1.NodeType))
// b = new SolidColorBrush(Colors.Red);
// else
// b = new SolidColorBrush(Colors.Blue);
// return new { X=a.X,Y=a.Y,br=b };
//}).ToList().ForEach(o =>
//{
// el = new Ellipse();
// el.Width = 10;
// el.Height = 10;
// el.Fill = o.br;
// Canvas.SetLeft(el, off_x + o.X * 100);
// Canvas.SetTop(el, off_y - o.Y * 100);
// canvas1.Children.Add(el);
//});
frame.Nodes.Where(o => legs_int.Contains(o.NodeType)).ToList().ForEach(o =>
{
SkeletonNode n = new SkeletonNode();
SkeletonNode nhip = new SkeletonNode();
double deg = Math.PI / 2;
n.X = (o.X + o.Z * Math.Tan(deg)) / Math.Sqrt(1 + Math.Tan(deg) * Math.Tan(deg));
n.Y = o.Y;
nhip.X = (hip.X + hip.Z * Math.Tan(deg)) / Math.Sqrt(1 + Math.Tan(deg) * Math.Tan(deg));
nhip.Y = hip.Y;
Point a = new Point();
Point a1 = new Point();
a.X = o.X - x;
a.Y = o.Y - y;
a.X = o.X - hip.X;
a.Y = o.Y - hip.Y;
//rotation
a1.X = n.X -nhip.X;
a1.Y = n.Y - nhip.Y;
SolidColorBrush b = new SolidColorBrush(Colors.Black);
if (leg_right.Contains(o.NodeType))
b = new SolidColorBrush(Colors.Red);
else
b = new SolidColorBrush(Colors.Blue);
el = new Ellipse();
//.........这里部分代码省略.........