本文整理汇总了C#中System.Point.Take方法的典型用法代码示例。如果您正苦于以下问题:C# Point.Take方法的具体用法?C# Point.Take怎么用?C# Point.Take使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Point
的用法示例。
在下文中一共展示了Point.Take方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TransformToCoordinateAndFlagSequence
/// <summary>
/// Gets the coordinate and flag sequence arrays to be set as property values.
/// </summary>
/// <param name="points">The points to be transformed.</param>
/// <param name="Coordinates">The coordinate sequence array.</param>
/// <param name="Flags">The flag sequence array.</param>
/// <param name="filterControlPoints">if set to <c>true</c> control points will be ignored during translation.</param>
/// <returns>
/// <c>true</c> if successfully transformed; otherwise, <c>false</c>.
/// </returns>
internal static bool TransformToCoordinateAndFlagSequence(List<PolyPointDescriptor> points, out Point[] Coordinates, out unodrawing.PolygonFlags[] Flags, bool filterControlPoints = false)
{
bool success = false;
Coordinates = null;
Flags = null;
if (points != null)
{
Coordinates = new Point[points.Count];
Flags = new unodrawing.PolygonFlags[points.Count];
if (points.Count > 0)
{
try
{
int i = 0;
foreach (var item in points)
{
if (!filterControlPoints || item.Flag == PolygonFlags.NORMAL)
{
// System.Linq.Enumerable.ElementAt(points, i);
Coordinates[i] = new Point(item.X, item.Y);
Flags[i] = (unodrawing.PolygonFlags)item.Flag;
i++;
}
}
if (i < points.Count)
{
Coordinates = Coordinates.Take(i).ToArray();
Flags = Flags.Take(i).ToArray();
//TODO: check if this works
}
}
catch { return false; }
}
success = true;
}
return success;
}