• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Shapes.Ellipse类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: CARD

 public CARD(card c)
     : base()
 {
     CardEllipse = new Ellipse();
     gridDef();
     EllipseDef(this.CardEllipse);
     base.Children.Add(this.CardEllipse);
     addImage(c.number, c);
     base.Tag = c;
     this.isHit = false;
 }
开发者ID:MohammedAbuissa,项目名称:SET,代码行数:11,代码来源:environment.cs


示例17: DrawCompass

        public void DrawCompass()
        {
            var circle = new Ellipse();
            circle.Width = this.drawingSurface.Width - 10;
            circle.Height = circle.Width;
            circle.StrokeThickness = 2;
            circle.Stroke = new SolidColorBrush(Colors.Goldenrod);
            circle.Margin = new Thickness(5);

            this.drawingSurface.Children.Add(circle);
        }
开发者ID:pierreca,项目名称:PilotTools,代码行数:11,代码来源:AirportDiagram.xaml.cs


示例18: CreateBall

 private static Grid CreateBall(double width, double height)
 {
     var g = new Grid { Width = width, Height = height };
     var ball = new Ellipse { Fill = new SolidColorBrush(Colors.Red), Opacity = .2 };
     var tb = new TextBlock { Text = "0", HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };
     Canvas.SetLeft(g, 0D);
     Canvas.SetTop(g, 0D);
     g.Children.Add(ball);
     g.Children.Add(tb);
     g.RenderTransformOrigin = new Point(.5, .5);
     return g;
 }
开发者ID:goeran,项目名称:ArtefactAnimator.Metro,代码行数:12,代码来源:Movement.xaml.cs


示例19: game

        public game()
        {
            this.InitializeComponent();
            this.navigationHelper = new NavigationHelper(this);
            this.navigationHelper.LoadState += this.NavigationHelper_LoadState;
            this.navigationHelper.SaveState += this.NavigationHelper_SaveState;
               
     StackPanel panel = new StackPanel();

     int i, j;
     Box_size = 9;
     gameBoxes = new Box[Box_size, Box_size];


            // init
     for (i = 0; i < Box_size; i++)
     {
         for (j = 0; j < Box_size; j++)
         {
             gameBoxes[i,j].left = false;
             gameBoxes[i,j].right = false;
             gameBoxes[i,j].down = false;
             gameBoxes[i, j].up = false;
             gameBoxes[i, j].coins = 1;
             gameBoxes[i, j].i = i;
             gameBoxes[i, j].j = j;
             gameBoxes[i,j].boundaries = 0;
         }
     }

     Ellipse rect;

     for (i = 0; i < ncols; i++)
     {
         for (j = 0; j < nrows; j++)
         {
             rect = new Ellipse();
             rect.Stroke = new SolidColorBrush(Windows.UI.Colors.White);
             rect.Fill = new SolidColorBrush(Windows.UI.Colors.White);
             rect.Width = thick;
             rect.Height = thick;
             Canvas.SetLeft(rect, i * multiplier + offset);
             Canvas.SetTop(rect, j * multiplier + offset);
             rect.StrokeThickness = 2;
             can.Children.Add(rect);
         }
     }
            
            array = new int[nrows, ncols];
            gamearea.Children.Add(panel);
            Start_timer();
        }
开发者ID:dhruvjain,项目名称:bindu,代码行数:52,代码来源:game.xaml.cs


示例20: update

 public static void update(GamePlay page, World w)
 {
     Spaceship ship = w.getSpaceship();
     ship.image.RenderTransform = new RotateTransform() { CenterX = ship.image.ActualWidth / 2, CenterY = ship.image.ActualHeight / 2, Angle = 180 * (Math.Atan2(ship.velocity.x, -ship.velocity.y)) / Math.PI };
     Ellipse ellipse = new Ellipse();
     ellipse.Width = 10;
     ellipse.Height = 10;
     ellipse.Margin = new Thickness(ship.getPosition().x, ship.getPosition().y, 0, 0);
     ellipse.StrokeThickness = 10.0;
     ellipse.Stroke = new SolidColorBrush(Colors.OrangeRed);
     page.ContentPanel1.Children.Add(ellipse);
     Vector mult = ship.velocity.times((float)ship.image.ActualHeight / (ship.velocity.getMagnitude()));
     ship.image.Margin = new Thickness(ship.getPosition().x + mult.x, ship.getPosition().y + mult.y, 0, 0);
 }
开发者ID:jdaerthe,项目名称:Planets,代码行数:14,代码来源:Graphics.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Shapes.Rectangle类代码示例发布时间:2022-05-26
下一篇:
C# Navigation.NavigationFailedEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap