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


C# CanvasDrawingSession.FillCircle方法代码示例

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


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

示例1: DrawCircle

        private void DrawCircle(CanvasControl sender, CanvasDrawingSession ds)
        {
            var width = (float) sender.ActualWidth;
            var height = (float) sender.ActualHeight;
            var stroke = this.defaultStroke;
            var radius = Math.Min(width, height) / 2 - stroke;
            var center = new Vector2(width / 2, height / 2);

            ds.FillCircle(center, radius, ForegroundColor);
            ds.DrawCircle(center, radius, GlowColor, stroke);
        }
开发者ID:shanselman,项目名称:BabySmashWindows10,代码行数:11,代码来源:GlowShapeCustomControl.cs

示例2: DrawNode

 private void DrawNode(CanvasDrawingSession ds, Node node)
 {
     ds.FillCircle(node.Position, hitTestRadius, backgroundColor);
     ds.DrawCircle(node.Position, hitTestRadius, foregroundColor, 4);
     ds.DrawText(node.Name, node.Position, foregroundColor, textFormat);
 }
开发者ID:GreatChieftain,项目名称:Graph-Helper,代码行数:6,代码来源:GraphControl.xaml.cs

示例3: DrawControlLines

        void DrawControlLines(CanvasDrawingSession drawingSession)
        {
            CanvasGradientMeshPatch[] patches = gradientMesh.Patches;

            for (int i=0; i<patchPoints.Count; ++i)
            {
                var pointArray = patchPoints[i];
                foreach (Vector2 point in pointArray)
                {
                    drawingSession.FillCircle(point, 7, Colors.White);
                }

                CanvasGradientMeshPatch patch = patches[i];
                bool showInterior = patchPoints[i].Length == 16;

                DrawBezier(drawingSession, patch.Point00, patch.Point01, patch.Point02, patch.Point03);
                DrawBezier(drawingSession, patch.Point03, patch.Point13, patch.Point23, patch.Point33);
                DrawBezier(drawingSession, patch.Point00, patch.Point10, patch.Point20, patch.Point30);
                DrawBezier(drawingSession, patch.Point30, patch.Point31, patch.Point32, patch.Point33);

                if (showInterior)
                {
                    DrawBezier(drawingSession, patch.Point10, patch.Point11, patch.Point12, patch.Point13);
                    DrawBezier(drawingSession, patch.Point20, patch.Point21, patch.Point22, patch.Point23);

                    DrawBezier(drawingSession, patch.Point01, patch.Point11, patch.Point21, patch.Point31);
                    DrawBezier(drawingSession, patch.Point02, patch.Point12, patch.Point22, patch.Point32);
                }

                drawingSession.DrawLine(patch.Point00, patch.Point01, Colors.White);
                drawingSession.DrawLine(patch.Point02, patch.Point03, Colors.White);

                drawingSession.DrawLine(patch.Point03, patch.Point13, Colors.White);
                drawingSession.DrawLine(patch.Point23, patch.Point33, Colors.White);

                drawingSession.DrawLine(patch.Point33, patch.Point32, Colors.White);
                drawingSession.DrawLine(patch.Point31, patch.Point30, Colors.White);

                drawingSession.DrawLine(patch.Point30, patch.Point20, Colors.White);
                drawingSession.DrawLine(patch.Point10, patch.Point00, Colors.White);

                if (showInterior)
                {
                    drawingSession.DrawLine(patch.Point01, patch.Point11, Colors.White);
                    drawingSession.DrawLine(patch.Point21, patch.Point31, Colors.White);

                    drawingSession.DrawLine(patch.Point02, patch.Point12, Colors.White);
                    drawingSession.DrawLine(patch.Point22, patch.Point32, Colors.White);

                    drawingSession.DrawLine(patch.Point10, patch.Point11, Colors.White);
                    drawingSession.DrawLine(patch.Point12, patch.Point13, Colors.White);

                    drawingSession.DrawLine(patch.Point20, patch.Point21, Colors.White);
                    drawingSession.DrawLine(patch.Point22, patch.Point23, Colors.White);
                }
            }
        }
开发者ID:fengweijp,项目名称:Win2D,代码行数:57,代码来源:GradientMeshExample.xaml.cs

示例4: DrawStuff


//.........这里部分代码省略.........
                    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
                        });

                    var r = NextRandomRect(horizontalLimit, verticalLimit);
                    ds.DrawRectangle(r, color);
                    ds.DrawText(
                        m_quiteLongText,
                        r,
开发者ID:gfcprogramer,项目名称:Win2D,代码行数:67,代码来源:MainPage.xaml.cs

示例5: Draw

            public void Draw(CanvasDrawingSession ds, float alpha = 1)
            {
                // Create a drop shadow by drawing a black circle with an offset position.
                const float dropShadowOffset = 4;

                ds.FillCircle(Position + new Vector2(dropShadowOffset), Radius, AdjustAlpha(Colors.Black, alpha));

                // Draw a white X.
                const float crossWidth = 3;
                float crossSize = Radius * 0.8f;

                Vector2 cross1 = new Vector2(crossSize, crossSize);
                Vector2 cross2 = new Vector2(crossSize, -crossSize);

                ds.DrawLine(Position - cross1, Position + cross1, AdjustAlpha(Colors.White, alpha), crossWidth);
                ds.DrawLine(Position - cross2, Position + cross2, AdjustAlpha(Colors.White, alpha), crossWidth);

                // Fill the circle with its unique color.
                ds.FillCircle(Position, Radius, AdjustAlpha(color, alpha));

                // White border around it.
                ds.DrawCircle(Position, Radius, AdjustAlpha(Colors.White, alpha));

                // Text label.
                ds.DrawText(label, Position, AdjustAlpha(Colors.White, alpha), textFormat);
            }
开发者ID:jiatingxiu,项目名称:Win2D,代码行数:26,代码来源:LayersExample.xaml.cs

示例6: Render

 public void Render(CanvasDrawingSession ds)
 {
     ds.FillCircle(m_x, m_y, m_radius, m_color);
 }
开发者ID:13thsymphony,项目名称:Toys,代码行数:4,代码来源:Firework.cs

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