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


C# Shapes.Ellipse类代码示例

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


Ellipse类属于Windows.UI.Xaml.Shapes命名空间,在下文中一共展示了Ellipse类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnTapped

        protected override void OnTapped(TappedRoutedEventArgs e) {
            Point pt = e.GetPosition(this);

            // Create dot
            Ellipse ellipse = new Ellipse {
                Width = 3,
                Height = 3,
                Fill = this.Foreground
            };

            Canvas.SetLeft(ellipse, pt.X);
            Canvas.SetTop(ellipse, pt.Y);
            canvas.Children.Add(ellipse);

            // Create text
            TextBlock txtblk = new TextBlock {
                Text = String.Format("{0}", pt),
                FontSize = 24
            };

            Canvas.SetLeft(txtblk, pt.X);
            Canvas.SetTop(txtblk, pt.Y);
            canvas.Children.Add(txtblk);

            e.Handled = true;

            base.OnTapped(e);
        }
开发者ID:ronlemire2,项目名称:UWP-Testers,代码行数:28,代码来源:TapAndShowPointPage.xaml.cs

示例2: 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

示例3: MainPage

        public MainPage()
        {
            Debug.WriteLine("Phone MainPage");
            this.InitializeComponent();

            this.NavigationCacheMode = NavigationCacheMode.Required;

            client = new Client(username, address, port);

            client.Connected += Client_Connected;
            client.Error += Client_Error;
            client.MessageReceived += Client_MessageReceived;

            MeasureButton.Click += MeasureButton_Click;
            MeasureButton_Hx.Click += MeasureButton_Hx_Click;
            GoToHxButton.Click += GoToHxButton_Click;

            // manual rfid button
            ScanText.PointerReleased += ScanText_PointerReleased;

            touchPoint = new Ellipse()
            {
                Width = 25,
                Height = 25,
                Fill = new SolidColorBrush(Windows.UI.Colors.Red),
                RenderTransform = new CompositeTransform()
            };
            touchPoint.Visibility = Visibility.Collapsed;

            Container.Children.Add(touchPoint);
            Container.PointerReleased += Container_PointerReleased;

            Debug.WriteLine("Phone MainPage End");
        }
开发者ID:tthmok,项目名称:ToolPath,代码行数:34,代码来源:MainPage.xaml.cs

示例4: CreateMarker

        private UIElement CreateMarker() {
            Canvas marker = new Canvas();
            Ellipse outer = new Ellipse() {
                Width = 25,
                Height = 25,
            };
            outer.Fill = new SolidColorBrush(Color.FromArgb(255,240,240,240));
            outer.Margin = new Thickness(-12.5, -12.5, 0, 0);

            Ellipse inner = new Ellipse() {
                Width = 20,
                Height = 20,
            };
            inner.Fill = new SolidColorBrush(Colors.Black);
            inner.Margin = new Thickness(-10, -10, 0, 0);

            Ellipse core = new Ellipse() {
                Width = 10,
                Height = 10,
            };
            core.Fill = new SolidColorBrush(Colors.White);
            core.Margin = new Thickness(-5, -5, 0, 0);
            marker.Children.Add(outer);
            marker.Children.Add(inner);
            marker.Children.Add(core);

            return marker;
        }
开发者ID:Vedolin,项目名称:wheelmap-windows-app,代码行数:28,代码来源:MyLocationOverlay.cs

示例5: BlankPage_Loaded

        void BlankPage_Loaded(object sender, RoutedEventArgs e)
        {
            PointerMoved += BlankPage_PointerMoved;


            for (var i = 0; i < Items.Length; i++)
            {
                var g = new Grid { Width = 30, Height = 30 };
                var ball = new Ellipse { Fill = new SolidColorBrush(Colors.Red), Opacity = .2 };
                var tb = new TextBlock { Text = "" + i, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };

                Canvas.SetLeft(g, 0D);
                Canvas.SetTop(g, 0D);

                Items[i] = g;

                g.Children.Add(ball);
                g.Children.Add(tb);
                g.RenderTransformOrigin = new Point(.5, .5);
                //g.Effect = new DropShadowEffect();

                LayoutRoot.Children.Add(g);
            }

            CompositionTarget.Rendering += (s, args) =>
            {
                //countTxt.Text = "EaseObjects in memory = " + EaseObject.EaseObjectRunningCount;
            };
        }
开发者ID:jgraup,项目名称:ArtefactAnimator.Metro,代码行数:29,代码来源:BlankPage.xaml.cs

示例6: ItemContainerGenerator_ItemsChanged

        private void ItemContainerGenerator_ItemsChanged(object sender, ItemsChangedEventArgs e)
        {
            if (e.Action == 1)
            {
                Position item = lstPositions.Items.Last() as Position;
                layers = new MapLayer();
                image = new BitmapImage();
                image.UriSource = (new Uri(SelectedFriend.Picture, UriKind.Absolute));

                grid = new Grid();
                grid.DataContext = item;
                grid.RightTapped += grid_RightTapped;
                textBlock = new TextBlock();
                textBlock.Text = item.Counter.ToString();
                textBlock.VerticalAlignment = VerticalAlignment.Bottom;
                textBlock.HorizontalAlignment = HorizontalAlignment.Center;
                brush = new ImageBrush();
                brush.ImageSource = image;
                ellipse = new Ellipse();
                ellipse.Height = 100;
                ellipse.Width = 100;
                ellipse.Fill = brush;
                grid.Children.Add(ellipse);
                grid.Children.Add(textBlock);
                layers.Children.Add(grid);
                MapLayer.SetPosition(grid, new Location(item.Latitude, item.Longitude));
                myMap.Children.Add(layers);
            }
        }
开发者ID:JorgeCupi,项目名称:SmartGuard,代码行数:29,代码来源:FriendInfoView.xaml.cs

示例7: 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

示例8: StarControlFactory

        public static UIElement StarControlFactory(double scale)
        {
            // Draw star shape
            Array starShapes = Enum.GetValues(typeof(StarShape));
            StarShape randomShape = (StarShape)starShapes.GetValue(_random.Next(0, starShapes.Length));

            UIElement starControl; //ISSUE: Is this type good?

            switch (randomShape)
            {
                case StarShape.Rectangle:
                    starControl = new Rectangle()
                    {Fill = new SolidColorBrush(RandomColor()) };

                    break;
                case StarShape.Ellipse:
                    starControl = new Ellipse()
                    { Fill = new SolidColorBrush(RandomColor()) };
                    break;
                case StarShape.Star:
                    starControl = new Star()
                    { Fill = new SolidColorBrush(RandomColor()) };
                    break;
                default:
                    starControl = new Star()
                    { Fill = new SolidColorBrush(RandomColor()) };
                    break;
            }

            return starControl;
        }
开发者ID:Arasz,项目名称:Invaders,代码行数:31,代码来源:InvadersHelper.cs

示例9: UpdateStations

        public void UpdateStations()
        {

            double minlon = 12.18;
            double minlat = 48.50;
            double maxlon = 18.93;
            double maxlat = 51.02;
            //lat - zespodu - nahoru
            //lon - zleva - doprava

            double lonC = overlay.Width / (maxlon - minlon);
            double latC = overlay.Height / (maxlat - minlat);

            double y;

            ColorQualityConverter ccq = new ColorQualityConverter();

            overlay.Children.Clear();

            foreach (Station s in App.ViewModel.Stations)
            {
                Ellipse el = new Ellipse();
                el.Width = 32;
                el.Height = 32;
                el.Fill = (Brush)ccq.Convert(s.Quality, typeof(Brush), null, null);
                if (s.Quality >= 7) el.Opacity = 0.5;
                Canvas.SetLeft(el, (s.Position.Longitude - minlon) * lonC);
                Canvas.SetTop(el, overlay.Height - ((s.Position.Latitude - minlat) * latC));
                overlay.Children.Add(el);
            }

        }
开发者ID:Qerts,项目名称:Projekt-Pollution-MKII,代码行数:32,代码来源:CzechMap.xaml.cs

示例10: 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

示例11: Block

 public Block(Ellipse q1, Ellipse q2, Ellipse q3, Ellipse q4)
 {
     foo = new Ellipse[4];
     foo[0] = q1;
     foo[1] = q2;
     foo[2] = q3;
     foo[3] = q4;
 }
开发者ID:Geotha,项目名称:Find4-Phone,代码行数:8,代码来源:Structures.cs

示例12: NPCHitAnimation

 public NPCHitAnimation(int hitatX, int hitatY)
 {
     Animations = new List<Shape>();
     Ellipse el = new Ellipse();
     el.Width = hitatX;
     el.Height = hitatY;
     Animations.Add(el);
 }
开发者ID:BilelAvans,项目名称:BallDrive,代码行数:8,代码来源:NPCHitAnimation.cs

示例13: canvas_PointerMoved

 private void canvas_PointerMoved(object sender, PointerRoutedEventArgs e)
 {
     nextPoint = e.GetCurrentPoint(canvas).Position;
     //Line l = new Line { X1 = prePoint.X, Y1 = prePoint.Y, X2 = nextPoint.X, Y2 = nextPoint.Y, StrokeThickness=5
     //    ,Stroke=new SolidColorBrush(Colors.Red )};
     Ellipse ellipse = new Ellipse { Width = 100, StrokeThickness = 5, Stroke = new SolidColorBrush(Colors.Red),Fill=new SolidColorBrush(Colors.Yellow )};
     canvas.Children.Add(ellipse);
     //prePoint = nextPoint;
 }
开发者ID:745322878,项目名称:Code,代码行数:9,代码来源:MainPage.xaml.cs

示例14: GetCircle

        private static UIElement GetCircle()
        {
            Ellipse ellipse = new Ellipse();
            ellipse.Fill = new SolidColorBrush(Colors.Red);
            ellipse.Stroke = new SolidColorBrush(Colors.Red);
            ellipse.Width = 50;
            ellipse.Height = 50;

            return ellipse;
        }
开发者ID:roydor,项目名称:BeCheweled,代码行数:10,代码来源:GamePiece.cs

示例15: DoDrawEllipse

 //draw a ellipse using windows store graphics
 protected override void DoDrawEllipse(Point topLeftPoint, Point bottomRightPoint)
 {
     Windows.UI.Xaml.Shapes.Ellipse ellipse = new Windows.UI.Xaml.Shapes.Ellipse();
     ellipse.Fill = new SolidColorBrush(Colors.Blue);
     ellipse.Width = bottomRightPoint.X - topLeftPoint.X;
     ellipse.Height = bottomRightPoint.Y - topLeftPoint.Y;
     Canvas.SetLeft(ellipse, topLeftPoint.X);
     Canvas.SetTop(ellipse, topLeftPoint.Y);
     _canvas.Children.Add(ellipse);
 }
开发者ID:housemeow,项目名称:MyPaint,代码行数:11,代码来源:WindowsStoreGraphics.cs


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