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


C# Drawing.Point类代码示例

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


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

示例1: Rectangle

 /// <summary>
 ///    <para>
 ///       Initializes a new instance of the Rectangle class with the specified location
 ///       and size.
 ///    </para>
 /// </summary>
 public Rectangle(Point location, Size size)
 {
     _x = location.X;
     _y = location.Y;
     _width = size.Width;
     _height = size.Height;
 }
开发者ID:ChuangYang,项目名称:corefx,代码行数:13,代码来源:Rectangle.cs

示例2: OnMouseDown

        protected override void OnMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);
            clickPoint = Cursor.Position;
            this.Capture = true;

        }
开发者ID:dbremner,项目名称:cecilstudio,代码行数:7,代码来源:TableLayoutSplitter.cs

示例3: MarkerImage

 public MarkerImage(string path, Size size, Point point, Point anchor)
 {
     Path = System.Web.VirtualPathUtility.ToAbsolute(path);
     Size = size;
     Point = point;
     Anchor = anchor;
 }
开发者ID:siralex91,项目名称:GooglemapMvc,代码行数:7,代码来源:MarkerImage.cs

示例4: BaseActor

 protected BaseActor(ILevelInfo info)
 {
     Info = info;
       Position = new Point(0, 0);
       IsAlive = true;
       CanDrop = false;
 }
开发者ID:Katee95,项目名称:NewGalaxy1,代码行数:7,代码来源:BaseActor.cs

示例5: initKalman

 private void initKalman()
 {
     last = lastEst = new System.Drawing.Point();
     kf = new Kalman(kfData.state,kfData.transitionMatrix, kfData.measurementMatrix, 
         kfData.processNoise, kfData.measurementNoise);
     kf.ErrorCovariancePost = kfData.errorCovariancePost;
 }
开发者ID:jungin,项目名称:kinect-finger-tracking,代码行数:7,代码来源:MouseDriver.cs

示例6: GetComeDirection

 internal static IComeDirection GetComeDirection(Point user, Point ball)
 {
     try
     {
         if (user.X == ball.X && user.Y - 1 == ball.Y)
             return IComeDirection.Down;
         if (user.X + 1 == ball.X && user.Y - 1 == ball.Y)
             return IComeDirection.DownLeft;
         if (user.X + 1 == ball.X && user.Y == ball.Y)
             return IComeDirection.Left;
         if (user.X + 1 == ball.X && user.Y + 1 == ball.Y)
             return IComeDirection.UpLeft;
         if (user.X == ball.X && user.Y + 1 == ball.Y)
             return IComeDirection.Up;
         if (user.X - 1 == ball.X && user.Y + 1 == ball.Y)
             return IComeDirection.UpRight;
         if (user.X - 1 == ball.X && user.Y == ball.Y)
             return IComeDirection.Right;
         if (user.X - 1 == ball.X && user.Y - 1 == ball.Y)
             return IComeDirection.DownRight;
         return IComeDirection.Null;
     }
     catch
     {
         return IComeDirection.Null;
     }
 }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:27,代码来源:ComeDirection.cs

示例7: glCanvas1_MouseDown

        private void glCanvas1_MouseDown(object sender, MouseEventArgs e)
        {
            this.lastMousePosition = e.Location;
            this.lastMouseDownPosition = e.Location;

            if (e.Button == System.Windows.Forms.MouseButtons.Right)
            {
                //// operate camera
                //rotator.SetBounds(this.glCanvas1.Width, this.glCanvas1.Height);
                //rotator.MouseDown(e.X, e.Y);
            }
            else if (e.Button == System.Windows.Forms.MouseButtons.Left)
            {
                // move vertex
                if (pickedGeometry != null)
                {
                    ViewPort viewPort = pickedGeometry.FromViewPort;
                    ICamera camera = viewPort.Camera;
                    var dragParam = new DragParam(
                        camera.GetPerspectiveProjectionMatrix(),
                        camera.GetViewMatrix(),
                        viewPort.Rect.ToViewport(),
                        new Point(e.X, glCanvas1.Height - e.Y - 1));
                    dragParam.pickedVertexIds.AddRange(pickedGeometry.VertexIds);
                    this.dragParam = dragParam;
                }
            }
        }
开发者ID:bitzhuwei,项目名称:CSharpGL,代码行数:28,代码来源:Form18PickingInScene.Picking.cs

示例8: GetBounds

 public Rectangle GetBounds(Point itemLocation, Size itemSize)
 {
     return new Rectangle((itemLocation.X + itemSize.Width) - locationFromRight.X,
                          itemLocation.Y,
                          size.Width,
                          size.Height);
 }
开发者ID:jeffboulanger,项目名称:connectuo,代码行数:7,代码来源:ShardListItemButton.cs

示例9: Rectangle

 public Rectangle(Point p, Size s)
 {
    X = p.X;
    Y = p.Y;
    Width = s.Width;
    Height = s.Height;
 }
开发者ID:joelmuzz,项目名称:Emgu-CV,代码行数:7,代码来源:Rectangle.cs

示例10: PrintNew

 private void PrintNew(int x, int y)
 {
     var point = new Point(x * scale, y * scale);
     var size = new Size(scale, scale);
     var rectangle = new Rectangle(point, size);
     graphics.FillEllipse(Brushes.Black, rectangle);
 }
开发者ID:TeoVincent,项目名称:MVC-and-MVP-by-example,代码行数:7,代码来源:WinFormView.cs

示例11: SetEditingMode

 /// <summary>
 /// Determines the editing mode from input position.</summary>
 /// <param name="p">Input position point</param>
 public override void SetEditingMode(Point p)
 {
     if (Bounds.Contains(p))
         EditingMode = EditMode.ByClick;
     else
         EditingMode = EditMode.None;
 }
开发者ID:sbambach,项目名称:ATF,代码行数:10,代码来源:BoolDataEditor.cs

示例12: ContainsSizeChangeArea

 /// <summary>
 /// ポイントがD&Dするとサイズが変更されるエリア内にあるかどうかを判定します。
 /// </summary>
 public bool ContainsSizeChangeArea(Point p)
 {
     return getTop().Contains(p) ||
         getBottom().Contains(p) ||
         getLeft().Contains(p) ||
         getRight().Contains(p);
 }
开发者ID:herpes,项目名称:GUITaskSetMaker,代码行数:10,代码来源:DDSizeChanger.cs

示例13: BaseMain_MouseDown

 private void BaseMain_MouseDown(object sender, MouseEventArgs e)
 {
   if (e.Button != MouseButtons.Left)
     return;
   this.mouseOff = new Point(-e.X, -e.Y);
   this.leftFlag = true;
 }
开发者ID:ciker,项目名称:201509LoginDemo,代码行数:7,代码来源:BaseMain.cs

示例14: ConvertToWindowsPointTest

 public void ConvertToWindowsPointTest()
 {
     var point = new Point(10, 10);
     System.Windows.Point winPoint = point.ConvertToWindowsPoint();
     Assert.That(winPoint.X, Is.EqualTo(10));
     Assert.That(winPoint.Y, Is.EqualTo(10));
 }
开发者ID:mdzn,项目名称:White,代码行数:7,代码来源:DrawingPointXTests.cs

示例15: ClickSaveConnection

 public void ClickSaveConnection()
 {
     WpfWindow theWindow = GetNewServerWindow();
     Point p = new Point(theWindow.BoundingRectangle.Left + 300, theWindow.BoundingRectangle.Top + 275);
     Mouse.Move(p);
     Mouse.Click();
 }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:7,代码来源:NewServerUIMap.cs


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