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


C# Drawing.Point类代码示例

本文整理汇总了C#中System.Drawing.Point的典型用法代码示例。如果您正苦于以下问题:C# System.Drawing.Point类的具体用法?C# System.Drawing.Point怎么用?C# System.Drawing.Point使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


System.Drawing.Point类属于命名空间,在下文中一共展示了System.Drawing.Point类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MetroForFly

        public MetroForFly(
            System.Windows.Forms.Control fatherControl, // 父容器
            int flyWidth,
            int flyHeight,
            System.Drawing.Point locationPoint,    // 整体位置
            System.Windows.Forms.AnchorStyles anchorstyle
            )
        {
            // 包裹外层
            var panelSec = new HPanel
            {
                Size = new System.Drawing.Size(flyWidth, flyHeight),
                Location = locationPoint,
                Anchor = anchorstyle,
                BackColor = System.Drawing.Color.Transparent
            };
            Size = new System.Drawing.Size(flyWidth + 3 + 12, flyHeight + 3);
            Location = new System.Drawing.Point(-3, -3);
            BackColor = System.Drawing.Color.Transparent;
            Anchor = BaseAnchor.AnchorFill;
            AllowDrop = true;
            AutoScroll = true;
            MouseDown += MetroForFly_MouseDown;
            DragEnter += MetroForFly_DragEnter;

            // 加载实体层
            panelSec.Controls.Add(this);
            // 加载包裹外层
            fatherControl.Controls.Add(panelSec);
        }
开发者ID:RyanFu,项目名称:A51C1B616A294D4BBD6D3D46FD7F78A7,代码行数:30,代码来源:MetroForFly.cs

示例2: MessageHandler

 // We take both the EditorForm's handle and its displayPanel handle, since messages
 // will sometimes be for the form, or the display panel.
 public MessageHandler( Panel displayPanel, EditorForm parent )
 {
     m_fakeFocus = false;
     m_displayPanel = displayPanel;
     m_parent = parent;
     m_mouseDownPosition = new System.Drawing.Point(0, 0); 
 }
开发者ID:Rocket-Buddha,项目名称:GameCode4,代码行数:9,代码来源:MessageHandler.cs

示例3: GetCursorPosition

 public Point GetCursorPosition()
 {
     var newPosition = new SysPoint();
     NativeMethods.GetCursorPos(ref newPosition);
     var screenspace = FromScreenPositionToScreenSpace(FromSysPoint(newPosition));
     return new Point((float)Math.Round(screenspace.X, 3), (float)Math.Round(screenspace.Y, 3));
 }
开发者ID:hillwhite,项目名称:DeltaEngine,代码行数:7,代码来源:CursorPositionTranslater.cs

示例4: PointToSystemPoint

 public void PointToSystemPoint()
 {
     var pt = new Point(2, 5);
     var actual = pt.ToSystemPoint();
     var expected = new System.Drawing.Point(2, 5);
     Assert.AreEqual(expected, actual);
 }
开发者ID:Mirandatz,项目名称:Trauer,代码行数:7,代码来源:PointTests.cs

示例5: MouseCallbackEventArgs

    internal MouseCallbackEventArgs(IntPtr pRhinoView, int button, int x, int y)
    {
      //const int btnNone = 0;
      const int btnLeft = 1;
      const int btnRight = 2;
      const int btnMiddle = 3;
      const int btnX = 4;

      m_pRhinoView = pRhinoView;
      switch (button)
      {
        case btnLeft:
          m_button = System.Windows.Forms.MouseButtons.Left;
          break;
        case btnMiddle:
          m_button = System.Windows.Forms.MouseButtons.Middle;
          break;
        case btnRight:
          m_button = System.Windows.Forms.MouseButtons.Right;
          break;
        case btnX:
          m_button = System.Windows.Forms.MouseButtons.XButton1;
          break;
        default: // or btnNone
          m_button = System.Windows.Forms.MouseButtons.None;
          break;
      }
      m_point = new System.Drawing.Point(x, y);
    }
开发者ID:austinlaw,项目名称:rhinocommon,代码行数:29,代码来源:rhinosdkmouse.cs

示例6: MazeData

 public MazeData()
 {
     Width = 0;
     Height = 0;
     startPoint = new System.Drawing.Point();
     endPoint = new System.Drawing.Point();
 }
开发者ID:NaturalWill,项目名称:FindingStar,代码行数:7,代码来源:MazeData.cs

示例7: ToggleButtonOn_Click

        private void ToggleButtonOn_Click(object sender, RoutedEventArgs e)
        {
            var isChecked = (bool)ToggleButtonOn.IsChecked;

            //m_brBotting.ToggleButtonOn = isChecked;

            if (isChecked)
            {
                var botAiType = (BotAiTypes)ComboBoxBotAi.SelectedIndex;
                var leaderPosition = int.Parse((string)ComboBoxLeaderCharacter.SelectionBoxItem);
                var nameBoxOffset = new System.Drawing.Point();
                var groupBoxOffset = new System.Drawing.Point();

                if (TextBoxNameBoxOffsetX.Text != null && TextBoxNameBoxOffsetX.Text.Length > 0)
                    nameBoxOffset.X = int.Parse(TextBoxNameBoxOffsetX.Text);
                if (TextBoxNameBoxOffsetY.Text != null && TextBoxNameBoxOffsetY.Text.Length > 0)
                    nameBoxOffset.Y = int.Parse(TextBoxNameBoxOffsetY.Text);

                if (TextBoxGroupBoxOffsetX.Text != null && TextBoxGroupBoxOffsetX.Text.Length > 0)
                    groupBoxOffset.X = int.Parse(TextBoxGroupBoxOffsetX.Text);
                if (TextBoxGroupBoxOffsetY.Text != null && TextBoxGroupBoxOffsetY.Text.Length > 0)
                    groupBoxOffset.Y = int.Parse(TextBoxGroupBoxOffsetY.Text);

                m_botSessionManager.StartSession(botAiType, leaderPosition, nameBoxOffset, groupBoxOffset);
            }
            else
            {
                m_botSessionManager.EndSession();
            }
        }
开发者ID:Chirmaya,项目名称:Everquest2Bot,代码行数:30,代码来源:MainWindow.xaml.cs

示例8: PN_Map_MouseClick

        private void PN_Map_MouseClick(object sender, MouseEventArgs e)
        {
            if (e.X / TileSize + 1 > map.MapSize.Width || e.Y / TileSize + 1 > map.MapSize.Height)
                return;

            if (e.Button == System.Windows.Forms.MouseButtons.Left)
            {
                System.Drawing.Point click = new System.Drawing.Point(e.X / TileSize, e.Y / TileSize);
                LayerSelector layerdlg = new LayerSelector();
                layerdlg.ShowDialog();
                if (layerdlg.confirmed)
                {
                    if (layerdlg.layer > -1 && layerdlg.layer < 3)
                    {
                        ConfirmationTeleportation confirmationdlg = new ConfirmationTeleportation(premier, layer, click, layerdlg.layer, firstMap, map);
                        confirmationdlg.ShowDialog();
                        if (confirmationdlg.pEventAjouté)
                        {
                            ajouté = true;
                            this.Close();
                        }
                    }
                }
            }
        }
开发者ID:rykdesjardins,项目名称:pixel-lion,代码行数:25,代码来源:SelectTeleportationForm.cs

示例9: ProcessCircuit

    private CircuitProcessingResult ProcessCircuit(TSPlayer triggerer, DPoint tileLocation, SignalType? overrideSignal = null, bool switchSender = true) {
      CircuitProcessor processor = new CircuitProcessor(this.PluginTrace, this, tileLocation);
      CircuitProcessingResult result = processor.ProcessCircuit(triggerer, overrideSignal, switchSender);

      this.NotifyPlayer(result);
      return result;
    }
开发者ID:romirom,项目名称:AdvancedCircuits-Plugin,代码行数:7,代码来源:CircuitHandler.cs

示例10: FindPath

 /// <summary>
 /// Oblicza ścieżkę dla obiektu.
 /// </summary>
 /// <param name="start">Punkt początkowy ścieżki</param>
 /// <param name="goal">Puntk docelowy</param>
 /// <param name="objectRadius">Promień kuli, która jest w stanie objąć cały obiekt</param>
 /// <param name="controllable">Obiekt, dla którego obliczana jest ścieżka</param>
 /// <param name="gameObjects">Lista wszystkich obiektów na planszy</param>
 public void FindPath(Point start, Point goal, int objectRadius, IControllable controllable, IEnumerable<GameObject> gameObjects)
 {
     msg = "";
     DateTime dateTime = DateTime.Now;
     if(!radiuses.Contains(objectRadius))
     {
         curProcessed = ProcessMap(map, objectRadius, out curAvgDifficulty);
         lastRadius = objectRadius;
         lock (maps)
         {
             radiuses.Add(lastRadius);
             avgDifficulties.Add(curAvgDifficulty);
             maps.Add(curProcessed);
         }
     }
     else
     {
         lastRadius = objectRadius;
         curProcessed = maps[radiuses.IndexOf(objectRadius)];
         curAvgDifficulty = avgDifficulties[radiuses.IndexOf(objectRadius)];
     }
     msg += (DateTime.Now - dateTime).ToString() + "\r\n";
     Thread th = new Thread(new ParameterizedThreadStart(AStar));
     pathTime = DateTime.Now;
     th.Start(new AStarArg(start,goal,controllable, gameObjects));
     //AStar(start, goal, out path);
 }
开发者ID:smarthaert,项目名称:icgame,代码行数:35,代码来源:PathFinder.cs

示例11: GetIndexFromFrame

 public System.Drawing.Point GetIndexFromFrame(int frame)
 {
     System.Drawing.Point point = new System.Drawing.Point();
     point.Y = frame / framesX;
     point.X = frame - (point.Y * framesY);
     return point;
 }
开发者ID:beamery,项目名称:bTris,代码行数:7,代码来源:AnimatedSprite.cs

示例12: add_anchor_window

        private void add_anchor_window(System.Windows.Forms.Form form)
        {
            var application = this.Application;
            var parent_window = application.ActiveWindow;
            if (parent_window == null)
            {
                return;
            }
            if (application.ActiveDocument == null)
            {
                return;
            }

            object window_states = IVisio.VisWindowStates.visWSFloating | IVisio.VisWindowStates.visWSVisible;
            object window_types = IVisio.VisWinTypes.visAnchorBarAddon;

            var displacement = new System.Drawing.Point(50, 100);
            var window_rect = new System.Drawing.Rectangle(displacement, form.Size);
            string window_caption = form.Text;

            var the_anchor_window = VA.Application.UserInterfaceHelper.AddAnchorWindow(parent_window,
                                                                                       window_caption,
                                                                                       window_states,
                                                                                       window_types,
                                                                                       window_rect);

            if (the_anchor_window != null)
            {
                VA.Application.UserInterfaceHelper.AttachWindowsForm(the_anchor_window, form);
                form.Refresh();
            }
        }
开发者ID:firestream99,项目名称:VisioAutomation,代码行数:32,代码来源:AddIn_customize.cs

示例13: IsTileInBetween

 public bool IsTileInBetween(DPoint tileLocation) {
   switch (this.Direction) {
     case Direction.Left:
       return (
         (this.FirstWireLocation.Y == tileLocation.Y) &&
         (tileLocation.X >= this.LastWireLocation.X && tileLocation.X <= this.FirstWireLocation.X)
       );
     case Direction.Right:
       return (
         (this.FirstWireLocation.Y == tileLocation.Y) &&
         (tileLocation.X >= this.FirstWireLocation.X && tileLocation.X <= this.LastWireLocation.X)
       );
     case Direction.Up:
       return (
         (this.FirstWireLocation.X == tileLocation.X) &&
         (tileLocation.Y >= this.LastWireLocation.Y && tileLocation.Y <= this.FirstWireLocation.Y)
       );
     case Direction.Down:
       return (
         (this.FirstWireLocation.X == tileLocation.X) &&
         (tileLocation.Y >= this.FirstWireLocation.Y && tileLocation.Y <= this.LastWireLocation.Y)
       );
     case Direction.Unknown:
       return (this.FirstWireLocation == tileLocation);
     default:
       throw new InvalidOperationException();
   }
 }
开发者ID:Enerdy,项目名称:AdvancedCircuits-Plugin,代码行数:28,代码来源:BranchProcessData.cs

示例14: BranchProcessData

 public BranchProcessData(DPoint branchingTileLocation, DPoint firstWireLocation, SignalType signal): this() {
   this.BranchingTileLocation = branchingTileLocation;
   this.FirstWireLocation = firstWireLocation;
   this.LastWireLocation = DPoint.Empty;
   this.Signal = signal;
   this.Direction = AdvancedCircuits.DirectionFromTileLocations(branchingTileLocation, firstWireLocation);
 }
开发者ID:Enerdy,项目名称:AdvancedCircuits-Plugin,代码行数:7,代码来源:BranchProcessData.cs

示例15: OverTurnStonesPhase

 public OverTurnStonesPhase(CellState colorToTurn)
 {
     _placePos = new System.Drawing.Point(-1, -1);
     _turnPosList = new List<System.Drawing.Point>();
     _colorToTurn = colorToTurn;
     Init();
 }
开发者ID:furinji,项目名称:Reversi,代码行数:7,代码来源:OverTurnStonesPhase.cs


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