本文整理匯總了C#中System.Drawing.RectangleF.RightNormal方法的典型用法代碼示例。如果您正苦於以下問題:C# RectangleF.RightNormal方法的具體用法?C# RectangleF.RightNormal怎麽用?C# RectangleF.RightNormal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Drawing.RectangleF
的用法示例。
在下文中一共展示了RectangleF.RightNormal方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: GetPointNormal
private Tuple<PointF, PointF> GetPointNormal(RectangleF rectA, RectangleF rectB)
{
var normal = new PointF();
var point = new PointF();
if (Math.Abs(rectA.Left - rectB.Left) < MathUtils.PRECISION)
{
normal = rectA.LeftNormal();
point = new PointF(rectA.Left, 0);
}
else if (Math.Abs(rectA.Top - rectB.Top) < MathUtils.PRECISION)
{
normal = rectA.TopNormal();
point = new PointF(0, rectA.Top);
}
else if (Math.Abs(rectA.Right - rectB.Right) < MathUtils.PRECISION)
{
normal = rectA.RightNormal();
point = new PointF(rectA.Right, 0);
}
else if (Math.Abs(rectA.Bottom - rectB.Bottom) < MathUtils.PRECISION)
{
normal = rectA.BottomNormal();
point = new PointF(0, rectA.Bottom);
}
return new Tuple<PointF,PointF>(point, normal);
}
示例2: GetNormal
private PointF GetNormal(RectangleF rectA, RectangleF rectB)
{
var normal = new PointF();
// var point = new PointF();
if (Math.Abs(rectA.Left - rectB.Left) < MathUtils.PRECISION &&
rectA.Height >= rectA.Width)
normal = rectA.LeftNormal();
else if (Math.Abs(rectA.Top - rectB.Top) < MathUtils.PRECISION &&
rectA.Width >= rectA.Height)
normal = rectA.TopNormal();
else if (Math.Abs(rectA.Right - rectB.Right) < MathUtils.PRECISION &&
rectA.Height >= rectA.Width)
normal = rectA.RightNormal();
else if (Math.Abs(rectA.Bottom - rectB.Bottom) < MathUtils.PRECISION &&
rectA.Width >= rectA.Height)
normal = rectA.BottomNormal();
else
throw new Exception("Normal Error");
return normal;
}