本文整理汇总了C#中LineCap.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# LineCap.ToString方法的具体用法?C# LineCap.ToString怎么用?C# LineCap.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LineCap
的用法示例。
在下文中一共展示了LineCap.ToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawEndAnchor
private void DrawEndAnchor(LineCap lc, CustomLineCap clc, Color col, float w, PointF pt, float angle, bool ignoreUnsupportedLineCaps)
{
SvgStyledTransformedElement anchor = null;
PointF[] points = null;
switch (lc) {
case LineCap.NoAnchor:
break;
case LineCap.Flat:
// TODO: what is the correct look?
break;
case LineCap.ArrowAnchor:
points = new PointF[3];
points[0] = new PointF(0, -w / 2f);
points[1] = new PointF(-w, w);
points[2] = new PointF(w, w);
anchor = new SvgPolygonElement(points);
break;
case LineCap.DiamondAnchor:
points = new PointF[4];
points[0] = new PointF(0, -w);
points[1] = new PointF(w, 0);
points[2] = new PointF(0, w);
points[3] = new PointF(-w, 0);
anchor = new SvgPolygonElement(points);
break;
case LineCap.RoundAnchor:
anchor = new SvgEllipseElement(0, 0, w, w);
break;
case LineCap.SquareAnchor:
float ww = (w / 3) * 2;
anchor = new SvgRectElement(0 - ww, 0 - ww, ww * 2, ww * 2);
break;
case LineCap.Custom:
if (clc != null)
{
if (!ignoreUnsupportedLineCaps)
throw new SvgGdiNotImpl("DrawEndAnchor custom");
}
break;
default:
if (!ignoreUnsupportedLineCaps)
throw new SvgGdiNotImpl("DrawEndAnchor " + lc.ToString());
break;
}
if (anchor == null)
return;
anchor.Id += "_line_anchor";
anchor.Style.Set("fill", new SvgColor(col));
anchor.Style.Set("stroke", "none");
Matrix rotation = new Matrix();
rotation.Rotate((angle / (float)Math.PI) * 180);
Matrix translation = new Matrix();
translation.Translate(pt.X, pt.Y);
anchor.Transform = new SvgTransformList(_transforms.Result.Clone());
anchor.Transform.Add(translation);
anchor.Transform.Add(rotation);
_cur.AddChild(anchor);
}