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


C# CanvasDrawingSession.FillEllipse方法代码示例

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


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

示例1: DrawOval

        private void DrawOval(CanvasControl sender, CanvasDrawingSession ds)
        {
            var width = (float) sender.ActualWidth;
            var height = (float) sender.ActualHeight;
            var center = new Vector2(width / 2, height / 2);
            var stroke = this.defaultStroke;
            var radiusX = (width / 3) - stroke;
            var radiusY = (height / 2) - stroke;

            ds.FillEllipse(center ,radiusX,radiusY, ForegroundColor);
            ds.DrawEllipse(center, radiusX, radiusY, GlowColor, stroke);
        }
开发者ID:shanselman,项目名称:BabySmashWindows10,代码行数:12,代码来源:GlowShapeCustomControl.cs

示例2: Draw

        public void Draw(CanvasDrawingSession ds)
        {
            int pointerPointIndex = 0;
            Vector2 prev = new Vector2(0, 0);
            const float penRadius = 10;
            foreach (Vector2 p in points)
            {
                if (pointerPointIndex != 0)
                {
                    ds.DrawLine(prev, p, Colors.DarkRed, penRadius * 2);
                }
                ds.FillEllipse(p, penRadius, penRadius, Colors.DarkRed);
                prev = p;
                pointerPointIndex++;
            }

            if (points.Count > 0)
                points.Dequeue();
        }
开发者ID:ben-sheeran,项目名称:Win2D,代码行数:19,代码来源:AnimatedControlExample.xaml.cs

示例3: DrawStuff


//.........这里部分代码省略.........

                case DrawnContentType.RoundedRectangle_Thin:
                    NextRandomRoundedRect(horizontalLimit, verticalLimit, out rect, out radiusX, out radiusY);
                    ds.DrawRoundedRectangle(
                        rect, radiusX, radiusY,
                        NextRandomColor());
                    break;

                case DrawnContentType.RoundedRectangle_Thick:
                    NextRandomRoundedRect(horizontalLimit, verticalLimit, out rect, out radiusX, out radiusY);
                    ds.DrawRoundedRectangle(
                        rect, radiusX, radiusY,
                        NextRandomColor(),
                        thickStrokeWidth);
                    break;

                case DrawnContentType.Ellipse_Thin:
                    NextRandomEllipse(horizontalLimit, verticalLimit, out point, out radiusX, out radiusY);
                    ds.DrawEllipse(
                        point, radiusX, radiusY,
                        NextRandomColor());
                    break;

                case DrawnContentType.Ellipse_Thick:
                    NextRandomEllipse(horizontalLimit, verticalLimit, out point, out radiusX, out radiusY);
                    ds.DrawEllipse(
                        point, radiusX, radiusY,
                        NextRandomColor(),
                        thickStrokeWidth);
                    break;

                case DrawnContentType.Ellipse_Fill:
                    NextRandomEllipse(horizontalLimit, verticalLimit, out point, out radiusX, out radiusY);
                    ds.FillEllipse(
                        point, radiusX, radiusY,
                        NextRandomColor());
                    break;

                case DrawnContentType.Circle_Fill:
                    ds.FillCircle(
                        NextRandomPoint(horizontalLimit, verticalLimit).ToVector2(),
                        100,
                        NextRandomColor());
                    break;

                case DrawnContentType.Dashed_Lines:
                    DrawDashedLines(ds, NextRandomColor(), horizontalLimit, verticalLimit);
                    break;

                case DrawnContentType.Text:
                    var p = NextRandomPoint(horizontalLimit, verticalLimit);
                    var x = (float)p.X;
                    var y = (float)p.Y;
                    var color = NextRandomColor();
                    ds.DrawLine(new Vector2(x, 0), new Vector2(x, verticalLimit), color);
                    ds.DrawLine(new Vector2(0, y), new Vector2(horizontalLimit, y), color);
                    ds.DrawText(
                        "Centered",
                        p.ToVector2(),
                        color,
                        new CanvasTextFormat()
                        {
                            FontSize = 18,
                            VerticalAlignment = CanvasVerticalAlignment.Center,
                            ParagraphAlignment = ParagraphAlignment.Center
                        });
开发者ID:gfcprogramer,项目名称:Win2D,代码行数:67,代码来源:MainPage.xaml.cs

示例4: DrawEllipseInternal

        private static void DrawEllipseInternal(
            CanvasDrawingSession ds,
            Color brush,
            Color pen,
            CanvasStrokeStyle ss,
            bool isStroked,
            bool isFilled,
            ref Rect2 rect,
            double strokeWidth)
        {
            double radiusX = rect.Width / 2.0;
            double radiusY = rect.Height / 2.0;
            double x = rect.X + radiusX;
            double y = rect.Y + radiusY;

            if (isFilled)
            {
                ds.FillEllipse(
                    (float)x,
                    (float)y,
                    (float)radiusX,
                    (float)radiusY,
                    brush);
            }

            if (isStroked)
            {
                ds.DrawEllipse(
                    (float)x,
                    (float)y,
                    (float)radiusX,
                    (float)radiusY,
                    pen,
                    (float)strokeWidth,
                    ss);
            }
        }
开发者ID:monocraft,项目名称:Test2d,代码行数:37,代码来源:Win2dRenderer.cs

示例5: Draw

            public void Draw(Vector2 pos, CanvasDrawingSession canvas)
            {
                //canvas.FillCircle(pos, _radius + 30, _color._glow);
                canvas.FillCircle(pos, _radius - 6, _color._main);
                canvas.FillCircle(pos, _radius - 2, _color._inner);
                canvas.FillCircle(pos, _radius, _color._outter);

                canvas.FillEllipse(new Vector2(pos.X, pos.Y - 20), _radius - 20, _radius - 30, Color.FromArgb(50, 255, 255, 255));
            }
开发者ID:xesf,项目名称:gamejam201601,代码行数:9,代码来源:MainPage.xaml.cs


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