本文整理汇总了C#中FillMode.ToPolyFillType方法的典型用法代码示例。如果您正苦于以下问题:C# FillMode.ToPolyFillType方法的具体用法?C# FillMode.ToPolyFillType怎么用?C# FillMode.ToPolyFillType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FillMode
的用法示例。
在下文中一共展示了FillMode.ToPolyFillType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Combine
public static List<List<Vector2>> Combine(List<List<Vector2>> subjectPolygons, List<List<Vector2>> clippingPolygons,
FillMode subjectFillMode, FillMode clipFillMode, CombineMode combineMode, out PolyTree tree)
{
Clipper.Clear();
Clipper.AddPaths(subjectPolygons, PolyType.ptSubject, true);
Clipper.AddPaths(clippingPolygons, PolyType.ptClip, true);
tree = new PolyTree();
Clipper.Execute(combineMode.ToClipType(), tree, subjectFillMode.ToPolyFillType(), clipFillMode.ToPolyFillType());
return Clipper.ClosedPathsFromPolyTree(tree);
}
示例2: Simplify
public static List<List<Vector2>> Simplify(List<Vector2> polygon, FillMode fillMode, out PolyTree tree)
{
Clipper.Clear();
Clipper.AddPath(polygon, PolyType.ptSubject, true);
Clipper.AddPath(polygon, PolyType.ptClip, true);
tree = new PolyTree();
PolyFillType fillType = fillMode.ToPolyFillType();
Clipper.Execute(ClipType.ctUnion, tree, fillType, fillType);
return Clipper.ClosedPathsFromPolyTree(tree);
}
示例3: Outline
public static List<List<Vector2>> Outline(List<Vector2> polygon, FillMode fillMode, bool closed, StrokeStyle strokeStyle, float strokeWidth, out PolyTree tree)
{
List<List<Vector2>> simplified = Clipper.SimplifyPolygon(polygon, fillMode.ToPolyFillType());
Offsetter.Clear();
Offsetter.MiterLimit = strokeStyle.MiterLimit;
Offsetter.AddPaths(simplified, (JoinType)strokeStyle.LineJoin, closed ? EndType.etClosedLine : strokeStyle.CapStyle.ToEndType());
tree = new PolyTree();
Offsetter.Execute(ref tree, strokeWidth / 2);
return Clipper.ClosedPathsFromPolyTree(tree);
}