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


C# Ellipse.SetValue方法代码示例

本文整理汇总了C#中Windows.UI.Xaml.Shapes.Ellipse.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# Ellipse.SetValue方法的具体用法?C# Ellipse.SetValue怎么用?C# Ellipse.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Windows.UI.Xaml.Shapes.Ellipse的用法示例。


在下文中一共展示了Ellipse.SetValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MainPage

        public MainPage()
        {
            this.InitializeComponent();

            initLedMatrixDevice();

            for (int i = 0; i < MATRIX_SIZE; i++)
            {
                TextBlock tb = new TextBlock();
                tb.Text = "0x00";
                tb.HorizontalAlignment = HorizontalAlignment.Center;
                tb.VerticalAlignment = VerticalAlignment.Center;
                tb.SetValue(Grid.RowProperty, i);
                tb.SetValue(Grid.ColumnProperty, MATRIX_SIZE);
                _matrix.Children.Add(tb);

                _matrixRowValue[i] = tb;

                for (int j = 0; j < MATRIX_SIZE; j++)
                {
                    Ellipse led = new Ellipse();
                    led.Width = 40;
                    led.Height = 40;
                    led.HorizontalAlignment = HorizontalAlignment.Center;
                    led.VerticalAlignment = VerticalAlignment.Center;
                    led.Fill = _off;
                    led.SetValue(Grid.RowProperty, i);
                    led.SetValue(Grid.ColumnProperty, j);
                    led.PointerPressed += Led_PointerPressed;
                    _matrix.Children.Add(led);

                    setMatrixData(i, j, 0);
                }
            }
        }
开发者ID:timothystewart6,项目名称:LED_Click_8x8,代码行数:35,代码来源:MainPage.xaml.cs

示例2: MainPage_Loaded

        private async void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            var width = this.ActualWidth;
            var height = this.ActualHeight;

            var min = Math.Min(width, height);

            var cwidth = min/8;
            for (var r = 0; r < 8; r++)
            {
                for (var c = 0; c < 8; c++)
                {
                    var ellipse = new Ellipse() {Width = cwidth, Height = cwidth};
                    grid.Children.Add(ellipse);
                    ellipse.Tag = r*8 + c;
                    ellipse.Stroke = new SolidColorBrush(Colors.White);
                    ellipse.Fill = _offBrush;
                    ellipse.PointerPressed += Ellipse_PointerPressed;
                    ellipse.SetValue(Grid.RowProperty, r);
                    ellipse.SetValue(Grid.ColumnProperty, c);
                }
            }

            _backpack = new Adafrut8x8LEDBackpack();
            await _backpack.initializeAsync();
        }
开发者ID:Seamless-Thingies,项目名称:CodeCamp2015-2,代码行数:26,代码来源:MainPage.xaml.cs

示例3: Activate

        private void Activate(Point2D item)
        {
            if (Map == null || Map.Layers == null)
            {
                return;
            }
            ellipse = new Ellipse();
            #region 所有风格的控制
            ellipse.Stroke = Stroke;
            ellipse.StrokeThickness = StrokeThickness;
            ellipse.Fill = Fill;
            ellipse.StrokeMiterLimit = StrokeMiterLimit;
            ellipse.StrokeDashOffset = StrokeDashOffset;
            ellipse.StrokeDashArray = StrokeDashArray;
            ellipse.StrokeDashCap = StrokeDashCap;
            ellipse.StrokeEndLineCap = StrokeEndLineCap;
            ellipse.StrokeLineJoin = StrokeLineJoin;
            ellipse.StrokeStartLineCap = StrokeStartLineCap;
            ellipse.Opacity = Opacity;
            #endregion

            DrawLayer = new ElementsLayer();
            Map.Layers.Add(DrawLayer);

            ellipse.SetValue(ElementsLayer.BBoxProperty, new Rectangle2D(item, item));
            DrawLayer.Children.Add(ellipse);

            isActivated = true;
            isDrawing = true;
        }
开发者ID:SuperMap,项目名称:iClient-for-Win8,代码行数:30,代码来源:DrawCircle.cs

示例4: createGameGrid

        private void createGameGrid(int gridSize)
        {
            int cols, rows;
            // create row and col definitions
            for( cols=0; cols < gridSize; cols++)
            {
                contentGrid.RowDefinitions.Add(new RowDefinition());
                contentGrid.ColumnDefinitions.Add(new ColumnDefinition());
            }

            // add rectangle to the grid squares
            // make them a little smaller
            Rectangle myR;
            for (cols = 0; cols < gridSize; cols++)
            {
                for (rows = 0; rows < gridSize; rows++)
                {
                    myR = new Rectangle();
                    myR.Name = "r" + cols.ToString() + "_" + rows.ToString(); // r0_1
                    myR.Width = (contentGrid.Width / gridSize) - 4;
                    myR.Height = (contentGrid.Height / gridSize) - 4;
                    myR.HorizontalAlignment = HorizontalAlignment.Center;
                    myR.VerticalAlignment = VerticalAlignment.Center;
                    myR.SetValue(Grid.RowProperty, rows);
                    myR.SetValue(Grid.ColumnProperty, cols);
                    myR.Fill = new SolidColorBrush(Colors.LightGray);
                    myR.Tapped += MyR_Tapped;
                    contentGrid.Children.Add(myR);
                }
            }

            Ellipse myE;

            //TransformGroup myTransformGroup = new TransformGroup();
            //TranslateTransform transTransForm;
            //transTransForm = new TranslateTransform();
            //transTransForm.X = contentGrid.Width * ((gridSize - 1) / gridSize);
            //transTransForm.Y = contentGrid.Height* ((gridSize - 1) / gridSize);
            //transTransForm.SetValue(NameProperty, "myTranslateTransform");
            //myTransformGroup.Children.Add(transTransForm);

            for (cols = 0; cols < 2; cols++)
            {
                myE = new Ellipse();
                myE.Name = "piece" + cols.ToString();
                myE.Height = (contentGrid.Height / gridSize) - 6;
                myE.Width = (contentGrid.Width / gridSize) - 6;
                myE.Stroke = new SolidColorBrush(Colors.Red);
                myE.StrokeThickness = 0;
                myE.Fill = new SolidColorBrush(Colors.Yellow);

                myE.SetValue(Grid.RowProperty, cols);
                myE.SetValue(Grid.ColumnProperty, cols);
                myE.Tapped += MyE_Tapped;

                //myE.RenderTransform = myTransformGroup;

                _ellipseHeight = myE.Height;
                _ellipseWidth = myE.Width;

                contentGrid.Children.Add(myE);
            }
        }
开发者ID:arkiq,项目名称:LabFebruary10,代码行数:63,代码来源:MainPage.xaml.cs

示例5: AddBackgroundRings

        private void AddBackgroundRings()
        {
            //Add outer background circle
            var outerRingBackground = new Ellipse
            {
                Width = (OuterRingRadius * 2) + StripWidth,
                Height = (OuterRingRadius * 2) + StripWidth,
                Stroke = new SolidColorBrush(Color.FromArgb(255, 30, 30, 30)),
                StrokeThickness = StripWidth
            };

            //Ensure these are drawn behind everything
            outerRingBackground.SetValue(ZIndexProperty, -5);

            SetLeft(outerRingBackground, (CentreX - OuterRingRadius - (StripWidth / 2)));
            SetTop(outerRingBackground, (CentreY - OuterRingRadius - (StripWidth / 2)));

            outerRingBackground.IsHitTestVisible = false;

            Children.Add(outerRingBackground);

            //Add inner background circle
            var innerRingBackground = new Ellipse
            {
                Width = (InnerRingRadius * 2) + StripWidth,
                Height = (InnerRingRadius * 2) + StripWidth,
                Stroke = new SolidColorBrush(Color.FromArgb(255, 50, 50, 50)),
                StrokeThickness = StripWidth
            };

            //Ensure these are drawn behind everything
            innerRingBackground.SetValue(ZIndexProperty, -5);

            SetLeft(innerRingBackground, (CentreX - InnerRingRadius - (StripWidth / 2)));
            SetTop(innerRingBackground, (CentreY - InnerRingRadius - (StripWidth / 2)));

            innerRingBackground.IsHitTestVisible = false;

            Children.Add(innerRingBackground);
        }
开发者ID:HimanshPal,项目名称:Naylah.Toolkit.UWP,代码行数:40,代码来源:CircularSliderControl.cs


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