• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Drawing.Point类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Execute

        public void Execute(Point startClick, Point endClick)
        {
            var pt = new System.Drawing.Point((int) startClick.X, (int) startClick.Y);

            if (askForColor)
            {
                colorDlg.ShowDialog();
                fillColor = colorDlg.Color;
            }

            Animation animation = Animation.getInstance();
            if (animation.PointInCell(startClick))
            {
                //Already Exisiting Cell
                Cell c = animation.findCell(startClick);
                int frame = _viewModel.currentFrame;
                c.color[frame] = fillColor;

                //Trigers and update on the View
                _viewModel.Cells.Remove(c);
                _viewModel.Cells.Add(c);
            }
            else
            {

                var finder = new RegionFinder(_viewModel.Image, pt, _viewModel.Tolerance);
                finder.LineFound +=
                    line => _viewModel.Cells.Add(new Cell(line.Select(p => new Point(p.X, p.Y)).ToArray(), animation.numFrames(), _viewModel.currentFrame, fillColor));
                finder.Process();

                //Add to the Model
                animation.addCell(_viewModel.Cells.Last());

            }
        }
开发者ID:byuhci,项目名称:Digital_Glass,代码行数:35,代码来源:FindCellCommand.cs


示例17: CVMinMaxLoc

        ///<summery>
        ///Finds global minimum and maximum in array or subarray.
        ///</summery>
        public static void CVMinMaxLoc(CVImage image,
            out double minVal,
            out double maxVal,
            out System.Drawing.Point minLocation,
            out System.Drawing.Point maxLocation,
            CVArr mask)
        {
            // Prepare out paramaters:
            __CvPoint min_loc = new __CvPoint();
            __CvPoint max_loc = new __CvPoint();
            double min_val = -1;
            double max_val = -1;

            //CvArr tempMask = 0;
            //if (mask != nullptr) {
            //    tempMask = mask->Array;
            //}
            //CVArr tempMask = mask.Array;

            minLocation = new System.Drawing.Point(0, 0);
            maxLocation = new System.Drawing.Point(0, 0);

            // Native call to openCV cvMinMaxLoc:
            PInvoke.cvMinMaxLoc(
                new __CvArrPtr(image),
                ref min_val, ref max_val,
                ref min_loc, ref max_loc, new __CvArrPtr(mask));

            minVal = min_val;
            maxVal = max_val;
            minLocation = new System.Drawing.Point(min_loc.x, min_loc.y);
            maxLocation = new System.Drawing.Point(max_loc.x, max_loc.y);
        }
开发者ID:ashersyed,项目名称:opencvdotnet,代码行数:36,代码来源:CVArithmetic.cs


示例18: Region

        /// <summary>
        /// Creates the Region
        /// </summary>
        /// <param name="statLog"></param>
        /// <param name="cacheManager"></param>
        public Region(ref StatLog statLog, ref CacheManager cacheManager)
        {
            // Store the statLog
            _statLog = statLog;

            // Store the cache manager
            _cacheManager = cacheManager;

            //default options
            _options = new RegionOptions();
            _options.width = 1024;
            _options.height = 768;
            _options.left = 0;
            _options.top = 0;
            _options.uri = null;

            Location = new System.Drawing.Point(_options.left, _options.top);
            Size = new System.Drawing.Size(_options.width, _options.height);
            BackColor = System.Drawing.Color.Transparent;

            if (Settings.Default.DoubleBuffering)
            {
                SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
                SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            }

            // Create a new BlackList for us to use
            _blackList = new BlackList();
        }
开发者ID:keyanmca,项目名称:xibo-custom,代码行数:34,代码来源:Region.cs


示例19: Protector_CheckProtected

 public bool Protector_CheckProtected(TSPlayer player, DPoint tileLocation, bool fullAccessRequired) {
   try {
     return !ProtectorPlugin.LatestInstance.ProtectionManager.CheckBlockAccess(player, tileLocation, fullAccessRequired);
   } catch (Exception ex) {
     throw new CooperatingPluginException(null, ex);
   }
 }
开发者ID:Enerdy,项目名称:AdvancedCircuits-Plugin,代码行数:7,代码来源:PluginCooperationHandler.cs


示例20: h_changePosition

        private void h_changePosition()
        {
            Size levelSize = Info.GetLevelSize();

            int yNewPosition = (int)(Position.Y + Math.Round(Math.Sin(Position.X / 20)));

            if (Position.X > (levelSize.Width - 100))
                direction = false;

            if (Position.X < 50)
                direction = true;

            if (direction)
            {
                if (Position.X < 150 || Position.X > levelSize.Width - 200)
                {
                    Position = new Point((int)(Position.X + MaxSpeed), yNewPosition + 3);
                }
                else
                {
                    Position = new Point((int)(Position.X + MaxSpeed), yNewPosition);
                }
            }
            else
            {
                if (Position.X < 150 || Position.X > levelSize.Width - 200)
                {
                    Position = new Point((int)(Position.X - MaxSpeed - 1), yNewPosition + 1);
                }
                else
                {
                    Position = new Point((int)(Position.X - MaxSpeed), yNewPosition);
                }
            }
        }
开发者ID:shamanping,项目名称:MyGelaxy,代码行数:35,代码来源:Thunderbolt.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Drawing.PointF类代码示例发布时间:2022-05-24
下一篇:
C# Drawing.Font类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap