当前位置: 首页>>代码示例>>C#>>正文


C# Point.Plus方法代码示例

本文整理汇总了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));
        }
开发者ID:Rupini,项目名称:HexEditor,代码行数:10,代码来源:HexGrid.cs

示例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;
        }
开发者ID:Rupini,项目名称:HexEditor,代码行数:29,代码来源:HexGrid.cs

示例3: MoveToCore

 public override void MoveToCore(Point newPosition)
 {
     base.MoveToCore(newPosition.Plus(0.2));
 }
开发者ID:ondrej11,项目名称:o106,代码行数:4,代码来源:AngleMeasurement.cs

示例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 { }
 }
开发者ID:manuxcgit,项目名称:CNC_manuxcgit,代码行数:32,代码来源:formMain.cs

示例5: MoveTo

 public Rectangle MoveTo(Point absolute)
 {
     return new Rectangle(absolute, absolute.Plus(_max.Minus(_min)));
 }
开发者ID:vidstige,项目名称:VectorUI,代码行数:4,代码来源:Rectangle.cs


注:本文中的Point.Plus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。