当前位置: 首页>>代码示例>>C#>>正文


C# Ellipse.SetValue方法代码示例

本文整理汇总了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);
 }
开发者ID:vvzwvv,项目名称:UWPTutorials,代码行数:10,代码来源:Library.cs

示例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();
    }
开发者ID:meniz,项目名称:WazeWP7,代码行数:60,代码来源:Syscalls.cs


注:本文中的Ellipse.SetValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。