本文整理汇总了C#中System.Drawing.PointF.GetUpperBound方法的典型用法代码示例。如果您正苦于以下问题:C# PointF.GetUpperBound方法的具体用法?C# PointF.GetUpperBound怎么用?C# PointF.GetUpperBound使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Drawing.PointF
的用法示例。
在下文中一共展示了PointF.GetUpperBound方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsUnrotated
/// <summary>
/// Verifies that the specified 4 points are not rotated - that each point shares either the x or y coordinate with the previous point
/// </summary>
/// <returns></returns>
public static bool IsUnrotated(PointF[] a)
{
PointF lastPoint = a[a.GetUpperBound(0)];
foreach (PointF p in a) {
if (p.X != lastPoint.X && p.Y != lastPoint.Y) return false;
lastPoint = p;
}
return true;
}
示例2: GetSubArray
/// <summary>
/// Grabs a single-dimension array from a 2 dimensional array, using the specified primary index.
/// </summary>
/// <param name="array"></param>
/// <param name="index"></param>
/// <returns></returns>
public static PointF[] GetSubArray(PointF[,] array, int index)
{
PointF[] sub = new PointF[array.GetUpperBound(1) + 1];
for (int i = 0; i < array.GetUpperBound(1) + 1; i++)
sub[i] = array[index, i];
return sub;
}