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

C# Drawing.Point类代码示例

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

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



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


示例16: PrintWay

 private void PrintWay(List<Location> loc, Color color, RadarForm form)
 {
     if (loc != null)
     {
         PointF[] points;
         Point tempP;
         Location ld;
         if (loc.Count != 0)
         {
             points = new PointF[loc.Count + 1];
             int i = 0;
             foreach (Location lo in loc)
             {
                 form.PrintCircle(color, form.OffsetY(lo.Y, ObjectManager.MyPlayer.Location.Y),
                                  form.OffsetX(lo.X, ObjectManager.MyPlayer.Location.X), "");
                 tempP = new Point(form.OffsetY(lo.Y, ObjectManager.MyPlayer.Location.Y),
                                   form.OffsetX(lo.X, ObjectManager.MyPlayer.Location.X));
                 points[i] = tempP;
                 i++;
             }
             ld = loc[0];
             tempP = new Point(form.OffsetY(ld.Y, ObjectManager.MyPlayer.Location.Y),
                               form.OffsetX(ld.X, ObjectManager.MyPlayer.Location.X));
             points[i] = tempP;
             form.ScreenDc.DrawLines(new Pen(_colorWaypoints), points);
         }
     }
 }
开发者ID:civicacid,项目名称:myevo,代码行数:28,代码来源:DrawWaypoints.cs


示例17: PauseScreen

        public PauseScreen(XElement reader, string basePath)
        {
            weapons = new List<PauseWeaponInfo>();
            inventory = new List<InventoryInfo>();

            XElement changeNode = reader.Element("ChangeSound");
            if (changeNode != null) ChangeSound = SoundInfo.FromXml(changeNode, basePath);

            XElement soundNode = reader.Element("PauseSound");
            if (soundNode != null) PauseSound = SoundInfo.FromXml(soundNode, basePath);

            XElement backgroundNode = reader.Element("Background");
            if (backgroundNode != null) Background = FilePath.FromRelative(backgroundNode.Value, basePath);

            foreach (XElement weapon in reader.Elements("Weapon"))
                weapons.Add(PauseWeaponInfo.FromXml(weapon, basePath));

            XElement livesNode = reader.Element("Lives");
            if (livesNode != null)
            {
                LivesPosition = new Point(livesNode.GetInteger("x"), livesNode.GetInteger("y"));
            }

            foreach (XElement inventoryNode in reader.Elements("Inventory"))
            {
                inventory.Add(InventoryInfo.FromXml(inventoryNode, basePath));
            }
        }
开发者ID:Tesserex,项目名称:CME-Common-Library,代码行数:28,代码来源:PauseScreen.cs


示例18: Zone

 public Zone(Point point1, Point point2, Point point3, Point point4)
 {
     Point1 = point1;
     Point2 = point2;
     Point3 = point3;
     Point4 = point4;
 }
开发者ID:faresali,项目名称:co-pserver,代码行数:7,代码来源:Zoning.cs


示例19: Clear

 /// <summary>
 ///     清除所有GroupItem
 /// </summary>
 public void Clear()
 {
     Controls.Clear();
     _conditionCount = 0;
     _conditionPos = new Point(10, 0);
     AddGroupItem();
 }
开发者ID:EricBlack,项目名称:MagicMongoDBTool,代码行数:10,代码来源:GroupPanel.cs


示例20: IsPartOfRectangle

 public bool IsPartOfRectangle(Point point)
 {
     if (Point1.Y >= point.Y && Point2.Y <= point.Y)
         if (point.X >= Point1.X && point.X <= Point3.X)
             return true;
     return false;
 }
开发者ID:faresali,项目名称:co-pserver,代码行数:7,代码来源:Zoning.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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