本文整理汇总了C#中Point.Plus方法的典型用法代码示例。如果您正苦于以下问题:C# Point.Plus方法的具体用法?C# Point.Plus怎么用?C# Point.Plus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point
的用法示例。
在下文中一共展示了Point.Plus方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderHex
private void RenderHex(DrawingContext dc, Point c, bool firstLine)
{
dc.DrawLine(hexPen, c.Plus(-a / 2.0, r), c.Plus(a / 2.0, r));
dc.DrawLine(hexPen, c.Plus(a / 2.0, r), c.Plus(a, 0));
dc.DrawLine(hexPen, c.Plus(a, 0), c.Plus(a / 2.0, -r));
if (firstLine) dc.DrawLine(hexPen, c.Plus(a / 2.0, -r), c.Plus(-a / 2.0, -r));
dc.DrawLine(hexPen, c.Plus(-a / 2.0, -r), c.Plus(-a, 0));
dc.DrawLine(hexPen, c.Plus(-a, 0), c.Plus(-a / 2.0, r));
}
示例2: GetHexInWorldFromScreen
//Update It!
private Point GetHexInWorldFromScreen(Point pointOnScreen)
{
var worldPoint = ToWorldPoint(pointOnScreen);
var x = Math.Ceiling(worldPoint.X / (3.0 * real_a)) * 3 * real_a;
var y = Math.Ceiling(worldPoint.Y / (2.0 * real_r)) * 2 * real_r;
if (Math.Abs(x - worldPoint.X) > real_a) x -= 3 * real_a;
if (Math.Abs(y - worldPoint.Y) > real_r) y -= 2 * real_r;
var hexCenter = new Point(x, y);
double minR = worldPoint.Minus(hexCenter).Abs();
if (minR > real_r * 1.025)
{
double minAlfa = 0;
for (double alfa = 0; alfa <= Math.PI * 2; alfa += Math.PI / 3.0)
{
double tryR = hexCenter.Plus(2 * real_r * Math.Sin(alfa), 2 * real_r * Math.Cos(alfa)).Minus(worldPoint).Abs();
if (tryR < minR)
{
minR = tryR;
minAlfa = alfa;
}
}
hexCenter = hexCenter.Plus(2 * real_r * Math.Sin(minAlfa), 2 * real_r * Math.Cos(minAlfa));
}
return hexCenter;
}
示例3: MoveToCore
public override void MoveToCore(Point newPosition)
{
base.MoveToCore(newPosition.Plus(0.2));
}
示例4: m_traiterBoutonVisu
void m_traiterBoutonVisu(object sender, EventArgs e)
{
Button v_button = new Button();
try
{
v_button = (Button)sender;
switch (v_button.Name)
{
case "bVisuGauche":
v_decalageVisu = v_decalageVisu.Plus(-50, 0);
break;
case "bVisuDroite":
v_decalageVisu = v_decalageVisu.Plus(50, 0);
break;
case "bVisuHaut":
v_decalageVisu = v_decalageVisu.Plus(0, 50);
break;
case "bVisuBas":
v_decalageVisu = v_decalageVisu.Plus(0, -50);
break;
case "bVisuLoupePlus":
v_echelleVisu++;
break;
case "bVisuLoupeMoins":
if (v_echelleVisu > 1) { v_echelleVisu--; }
break;
}
lEchelle.Text = v_echelleVisu.ToString();
m_dessinerVisu();
}
catch { }
}
示例5: MoveTo
public Rectangle MoveTo(Point absolute)
{
return new Rectangle(absolute, absolute.Plus(_max.Minus(_min)));
}