本文整理汇总了C#中Ellipse.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# Ellipse.SetValue方法的具体用法?C# Ellipse.SetValue怎么用?C# Ellipse.SetValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ellipse
的用法示例。
在下文中一共展示了Ellipse.SetValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: add
private void add(Grid grid, int row, int column)
{
Ellipse dot = new Ellipse();
dot.Width = 20;
dot.Height = 20;
dot.Fill = new SolidColorBrush(Colors.White);
dot.SetValue(Grid.ColumnProperty, column);
dot.SetValue(Grid.RowProperty, row);
grid.Children.Add(dot);
}
示例2: NOPH_Graphics_fillArc
public static void NOPH_Graphics_fillArc(int __graphics, int x, int y, int width, int height, int startAngle, int arcAngle)
{
Color curr_pen = curr_color;
//mre.Reset();
int copy_graphics, copy_x, copy_y, copy_width, copy_height, copy_startAngle, copy_arcAngle;
copy_graphics = __graphics; copy_x = x; copy_y = y; copy_width = width; copy_height = height; copy_startAngle = startAngle; copy_arcAngle = arcAngle;
System.Windows.Deployment.Current.Dispatcher.BeginInvoke(() =>
{
Canvas graphics = (Canvas)CRunTime.objectRepository[copy_graphics];
if (copy_arcAngle - copy_startAngle == 360)
{
Ellipse myEllipse = new Ellipse();
SolidColorBrush mySolidColorBrush = new SolidColorBrush();
mySolidColorBrush.Color = curr_pen;
myEllipse.Fill = mySolidColorBrush;
myEllipse.StrokeThickness = 1;
myEllipse.Stroke = mySolidColorBrush;
myEllipse.Width = copy_width;
myEllipse.Height = copy_height;
myEllipse.SetValue(Canvas.LeftProperty, (double)copy_x);
myEllipse.SetValue(Canvas.TopProperty, (double)copy_y);
children_list.Add(myEllipse);// graphics.Children.Add(myEllipse);
}
else
{
SolidColorBrush fb = new SolidColorBrush(curr_pen);
System.Windows.Shapes.Path path1 = new System.Windows.Shapes.Path();
PathGeometry pg1 = new PathGeometry();
PathFigure pf1 = new PathFigure();
pf1.StartPoint = new Point(copy_x, copy_y);
//set up the segments collection
PathSegmentCollection segments = new PathSegmentCollection();
//arc1
ArcSegment arc1 = new ArcSegment();
arc1.Point = new Point(copy_width + copy_x, copy_height + copy_y);
arc1.Size = new Size(copy_width, copy_height);
arc1.IsLargeArc = (copy_arcAngle - copy_startAngle) > 180 ? true : false;
arc1.SweepDirection = SweepDirection.Clockwise;
segments.Add(arc1);
//Set up the path
pf1.Segments = segments;
pg1.Figures.Add(pf1);
path1.Data = pg1;
path1.Fill = fb;
path1.Stroke = fb;
path1.StrokeThickness = 1;
children_list.Add(path1);// graphics.Children.Add(path1);
}
//mre.Set();
});
//mre.WaitOne();
}