本文整理汇总了C#中Glyph.AddFilledCircle方法的典型用法代码示例。如果您正苦于以下问题:C# Glyph.AddFilledCircle方法的具体用法?C# Glyph.AddFilledCircle怎么用?C# Glyph.AddFilledCircle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Glyph
的用法示例。
在下文中一共展示了Glyph.AddFilledCircle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddToMapGlyph
// Add the stroke to an OCAD Map glyph with the given box size.
public void AddToMapGlyph(Glyph glyph, SymColor color, float boxSize)
{
float scaleFactor = boxSize / 200.0F; // symbols are designed in box from -100 to 100.
switch (kind) {
case SymbolStrokes.Disc:
glyph.AddFilledCircle(color, new PointF(points[0].X * scaleFactor, points[0].Y * scaleFactor), radius * 2 * scaleFactor);
break;
case SymbolStrokes.Circle:
glyph.AddCircle(color, new PointF(points[0].X * scaleFactor, points[0].Y * scaleFactor), thickness * scaleFactor, (radius * 2 + thickness) * scaleFactor);
break;
case SymbolStrokes.Polyline: {
PointKind[] pathKinds = new PointKind[points.Length];
PointF[] pathPoints = new PointF[points.Length];
for (int i = 0; i < points.Length; ++i) {
pathKinds[i] = PointKind.Normal;
pathPoints[i] = new PointF(points[i].X * scaleFactor, points[i].Y * scaleFactor);
}
SymPath path = new SymPath(pathPoints, pathKinds);
glyph.AddLine(color, path, thickness * scaleFactor, corners, ends);
break;
}
case SymbolStrokes.Polygon: {
PointKind[] pathKinds = new PointKind[points.Length + 1];
PointF[] pathPoints = new PointF[points.Length + 1];
for (int i = 0; i < points.Length; ++i) {
pathKinds[i] = PointKind.Normal;
pathPoints[i] = new PointF(points[i].X * scaleFactor, points[i].Y * scaleFactor);
}
pathKinds[points.Length] = pathKinds[0];
pathPoints[points.Length] = pathPoints[0];
SymPath path = new SymPath(pathPoints, pathKinds);
glyph.AddLine(color, path, thickness * scaleFactor, corners, corners == LineJoin.Round ? LineCap.Round : LineCap.Flat);
break;
}
case SymbolStrokes.FilledPolygon: {
PointKind[] pathKinds = new PointKind[points.Length + 1];
PointF[] pathPoints = new PointF[points.Length + 1];
for (int i = 0; i < points.Length; ++i) {
pathKinds[i] = PointKind.Normal;
pathPoints[i] = new PointF(points[i].X * scaleFactor, points[i].Y * scaleFactor);
}
pathKinds[points.Length] = pathKinds[0];
pathPoints[points.Length] = pathPoints[0];
SymPath path = new SymPath(pathPoints, pathKinds);
glyph.AddArea(color, new SymPathWithHoles(path, null));
break;
}
case SymbolStrokes.PolyBezier: {
PointKind[] pathKinds = new PointKind[points.Length];
PointF[] pathPoints = new PointF[points.Length];
for (int i = 0; i < points.Length; ++i) {
pathKinds[i] = (i % 3 == 0) ? PointKind.Normal : PointKind.BezierControl;
pathPoints[i] = new PointF(points[i].X * scaleFactor, points[i].Y * scaleFactor);
}
SymPath path = new SymPath(pathPoints, pathKinds);
glyph.AddLine(color, path, thickness * scaleFactor, corners, ends);
break;
}
case SymbolStrokes.FilledPolyBezier: {
PointKind[] pathKinds = new PointKind[points.Length];
PointF[] pathPoints = new PointF[points.Length];
for (int i = 0; i < points.Length; ++i) {
pathKinds[i] = (i % 3 == 0) ? PointKind.Normal : PointKind.BezierControl;
pathPoints[i] = new PointF(points[i].X * scaleFactor, points[i].Y * scaleFactor);
}
SymPath path = new SymPath(pathPoints, pathKinds);
glyph.AddArea(color, new SymPathWithHoles(path, null));
break;
}
default:
Debug.Fail("Bad SymbolStroke kind");
break;
}
}
示例2: CreateSymDef
protected override SymDef CreateSymDef(Map map, SymColor symColor)
{
Glyph glyph = new Glyph();
glyph.AddCircle(symColor, new PointF(0.0F, 0.0F), NormalCourseAppearance.lineThickness * scaleRatio * appearance.lineWidth, diameter * scaleRatio * appearance.controlCircleSize);
if (appearance.centerDotDiameter > 0.0F) {
glyph.AddFilledCircle(symColor, new PointF(0.0F, 0.0F), appearance.centerDotDiameter * scaleRatio);
}
glyph.ConstructionComplete();
PointSymDef symdef = new PointSymDef("Control point", "702", glyph, false);
symdef.ToolboxImage = MapUtil.CreateToolboxIcon(Properties.Resources.Control_OcadToolbox);
map.AddSymdef(symdef);
return symdef;
}