本文整理汇总了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);
}
示例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();
}
示例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
});
示例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);
}
}
示例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));
}