本文整理汇总了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);
}
示例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);
}
示例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);
}
}
}
示例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,
示例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);
}
示例6: Render
public void Render(CanvasDrawingSession ds)
{
ds.FillCircle(m_x, m_y, m_radius, m_color);
}
示例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));
}