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


C# Point.ToString方法代码示例

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


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

示例1: AddPoint

 public void AddPoint(Point pt)
 {
     if(this.point_dict.ContainsKey(pt.ToString()))
     {
         MessageBox.Show("添加坐标失败:\n不能添加已在列表中的坐标!");
         return;
     }
     this.point_dict[pt.ToString()] = pt;
     this.lbxScatterPoints.Items.Add(pt.ToString());
 }
开发者ID:Yinzhe-Qi,项目名称:RPS,代码行数:10,代码来源:FormAddScatter.cs

示例2: CanvasMouseUp

 void CanvasMouseUp(object sender, MouseEventArgs e)
 {
     this.Cursor = Cursors.Default;
     e_pt = e.Location;
     if ( s_pt != Point.Empty)
         MessageBox.Show("From "+s_pt.ToString()+"to "+e_pt.ToString());
 }
开发者ID:lomatus,项目名称:SharpDxf,代码行数:7,代码来源:Canvas.cs

示例3: InitMap

        public void InitMap()
        {
            Graphics g = pictureBox1.CreateGraphics();
            int i = 0;
            foreach(Jour J in _list_Jour)
            {
                foreach(ActJour A in J.ListAct)
                {

                    if (A.Ext)
                    {
                        PictureBox PB = new PictureBox();
                        PB.Size = new System.Drawing.Size(20, 20);
                        PB.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
                        Point P = new Point(A.X+700 / 5, (1000 / 5) -A.Y);
                        PB.Location = P;
                        PB.Click += new System.EventHandler(this.PB_Click);
                        PB.Name = i.ToString();
                        PB.Image = ActImage(A, J);
                        PB.BackColor= Color.Transparent;
                        PB.Visible = true;
                        Lpb.Add(PB);
                        labelInfo.Text = P.ToString();
                        ListInfo.Add(InfoAct(A, J));
                        pictureBox1.Controls.Add(PB);
                        i++;
                    }
                }
            }
        }
开发者ID:debatg,项目名称:Projet_Mars,代码行数:30,代码来源:PanelExplor.cs

示例4: MainForm_MouseDown

        private void MainForm_MouseDown(object sender, MouseEventArgs e)
        {
            if (checkBoxAddPoint.Checked)
            {
                scene.DataPoints.Add(new PointD(e.X, e.Y));
                this.Invalidate();
                return;
            }

            mouse_start = e.Location;
            this.Text = mouse_start.ToString();
            capture = scene.HitTest(e.X, e.Y);
            switch (capture)
            {
                case 1:
                    point_start = scene.CurrentBezier.Point1;
                    break;

                case 2:
                    point_start = scene.CurrentBezier.Point2;
                    break;

                case 3:
                    point_start = scene.CurrentBezier.Point3;
                    break;

                case 4:
                    point_start = scene.CurrentBezier.Point4;
                    break;

                default:
                    break;
            }
        }
开发者ID:EFanZh,项目名称:EFanZh,代码行数:34,代码来源:MainForm.cs

示例5: adjustLocation

 private static void adjustLocation(XmlNode destNode, Point offset)
 {
     if (offset.ToString() != "0,0")
     {
         Point location = getLocationAttribute(destNode);
         location.X += offset.X;
         location.Y += offset.Y;
         setLocationAttribute(destNode, location);
     }
 }
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:10,代码来源:ConvertTemplate.cs

示例6: GetPiece

		/// <summary>
		/// Returns the <see cref="Piece"/> object at the specified co-ordinates.
		/// </summary>
		/// <param name="position">
		/// The position of the piece to get.
		/// </param>
		/// <exception cref="IndexOutOfRangeException">
		/// Thrown if the X and Y values in <i>position</i> are invalid.
		/// </exception>
		/// <returns>
		/// The <see cref="Piece"/> object at the requested position.
		/// </returns>
		public Player GetPiece(Point position)
		{
			if (position.X < 0 || position.X > (Board.Dimension) ||
				position.Y < 0 || position.Y > (Board.Dimension))
			{
				throw new IndexOutOfRangeException(
					"Point " + position.ToString() + " is out of range.");
			}

			int shiftOut = this.GetShiftOut(position.X, position.Y);
			return (Player)((this.pieces >> shiftOut) & 3L);
		}
开发者ID:JasonBock,项目名称:Quixo,代码行数:24,代码来源:Board.cs

示例7: EndSelect

        public void EndSelect(GraphApp app, GraphAppGUI appGUI, Point p, bool shiftHeld)
        {
            Console.WriteLine("Selection end: " + p.ToString());
            Started = false;

            endPoint = p;
            Rectangle selectionRect = getSelectionRectangle(startPoint, endPoint);

            GraphPanel gp = appGUI.CurrentGraphPanel;
            if (!shiftHeld)
            {
                gp.Deselect();
            }
            List<ISelectable> selectables = gp.Selectables;

            int selectTotal = 0;

            foreach (ISelectable s in selectables)
            {
                if (s.Intersects(selectionRect))
                {
                    bool filterPass = false;
                    foreach (SelectionFilter filter in filters)
                    {
                        if (filter.PassesFilter(s.GetItem()))
                        {
                            filterPass = true;
                        }
                    }

                    if (!filterPass)
                    {
                        continue;
                    }
                    gp.Select(s);
                    s.Select();
                    selectTotal++;
                    Console.WriteLine("Selected " + s.ToString());
                }
            }

            if (selectTotal == 0)
            {
                Console.WriteLine("Selected nothing");
                gp.Deselect();
            }

            gp.Refresh();
        }
开发者ID:bschwind,项目名称:Graph-App,代码行数:49,代码来源:SelectTool.cs

示例8: EdgeConstructorTest

        public void EdgeConstructorTest()
        {
            //Arrange
            Vertex v1 = new Vertex(100, new Point(100, 100));
            Vertex v2 = new Vertex(200, new Point(200, 200));
            int cost = 500;
            Point stringPosition = new Point(300,300);

            //Act
            Edge target = new Edge(v1, v2, cost, stringPosition);

            //Assert
            Assert.AreEqual(target.V1.Name, v1.Name);
            Assert.AreEqual(target.V2.Name, v2.Name);
            Assert.AreEqual(target.Cost, cost);
            Assert.AreEqual(target.StringPosition.ToString(), stringPosition.ToString());
        }
开发者ID:Omar-Salem,项目名称:Kruskal-Algorithm,代码行数:17,代码来源:EdgeTest.cs

示例9: courtBox_MouseDown

        private void courtBox_MouseDown(object sender, MouseEventArgs e)
        {
            const int imageBorder = 6;
            const float xSize = 1199;
            const float ySize = 716;

            MouseButtons currButton = e.Button;
            Point loc = new Point(e.X, e.Y);

            /* We need to get the location of the click in "ESPN" coordinates.  That is, the top left corner is (0,0)
             * and the bottom right corner is (940, 500). */
            loc.X = (int)((loc.X - imageBorder) / xSize * 940);
            loc.Y = (int)((loc.Y - imageBorder) / ySize * 500);

            Console.WriteLine("Click registered:");
            Console.WriteLine("\t" + loc.ToString());
            Console.WriteLine("\t" + currButton.ToString());
        }
开发者ID:brandonforster,项目名称:20-20,代码行数:18,代码来源:GameForm.cs

示例10: Main

        static void Main(string[] args)
        {
            int bufSize = 256;
            StringBuilder sb = new StringBuilder(bufSize);

            Rectangle rect = new Rectangle(0, 0, 100, 100);

            if (SetNHW32())
            {
                {
                    for (;;)
                    {
                        int i = 1;
                        int j = 0;
                        Point cursorPoint = new Point();
                        GetCursorPos(ref cursorPoint);
                        BL_SetFlag32((uint)GetWordFlag.enable, IntPtr.Zero, cursorPoint.X, cursorPoint.Y);
                        Thread.Sleep(1000);
                        BL_GetText32(sb, bufSize, ref rect);
                        System.Console.WriteLine(sb.ToString() + " " + rect.ToString() + " " + cursorPoint.ToString());
                    }
                }
            }
        }
开发者ID:Letractively,项目名称:lunar-thu,代码行数:24,代码来源:Program.cs

示例11: Init

        public void Init(Form1 mainForm, CoronaJointure joint)
        {
            this.MainForm = mainForm;
            this.cJoint = joint;
            modePanel = "NEW";

            if (this.cJoint.type.Equals("WHEEL")) {
                this.objA = cJoint.coronaObjA;
                obj1Tb.Text = objA.DisplayObject.Name;
                this.objB = cJoint.coronaObjB;
                obj2Tb.Text = objB.DisplayObject.Name;

                this.axisDistance = cJoint.axisDistance;
                axisDistanceTb.Text = axisDistance.ToString();

                this.setAnchorPoint(cJoint.AnchorPointA);

                motorSpeedNup.Value = Convert.ToInt32(cJoint.motorSpeed);

                motorForceNup.Value = Convert.ToInt32( cJoint.maxMotorTorque);

                modePanel = "MODIFY";
            }
        }
开发者ID:nadar71,项目名称:Krea,代码行数:24,代码来源:WheelPropertiesPanel.cs

示例12: PointToScreen

        public Point PointToScreen(Point point)
        {
            if (!Functions.ClientToScreen(window.Handle, ref point))
                throw new InvalidOperationException(String.Format(
                    "Could not convert point {0} from screen to client coordinates. Windows error: {1}",
                    point.ToString(), Marshal.GetLastWin32Error()));

            return point;
        }
开发者ID:raphaelts3,项目名称:opentk,代码行数:9,代码来源:WinGLNative.cs

示例13: tsbtnLocalization_Click

        private void tsbtnLocalization_Click(object sender, EventArgs e)
        {
            if (this.current_fingerprint == null)
                return;
            FormLocalizationSetting fls = new FormLocalizationSetting();
            if (this.current_dbpath != null)
                fls.DBpath = this.current_dbpath;
            if (fls.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                System.Runtime.Serialization.IFormatter formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
                FileStream fs = new FileStream(fls.DBpath, FileMode.Open, FileAccess.Read, FileShare.Read);
                FingerprintDataBase fdb = (FingerprintDataBase)formatter.Deserialize(fs);
                fs.Close();
                FingerprintDataBase.Match_Strategy match_strategy = fls.MatchStrategy;
                double[] args = fls.Args;
                PointF loc = (new FingerprintDataBase(fdb.loc_fingerprint_dict, fdb.map)).MatchLocation(this.current_fingerprint[this.FingerprintName], match_strategy, args);
                this.current_dbpath = fls.DBpath;

                Point pt_real = new Point();
                foreach (Transmitter trans in this.viz_rps.Map.Transmitters)
                    pt_real = trans.Location;
                lbxLocResult.Items.Add("真实\t" + pt_real.ToString());
                lbxLocResult.Items.Add("估计\t" + loc.ToString());
                double err_pxl = new MathUtils.MathUtility().point_dist(pt_real, loc);
                lbxLocResult.Items.Add("误差(p)\t" + err_pxl.ToString("0.00"));
                lbxLocResult.Items.Add("误差(m)\t" + (err_pxl * this.viz_rps.Map.MeterPixelRatio).ToString("0.00"));
                lbxLocResult.Items.Add("--------------");
                lbxLocResult.SelectedIndex = lbxLocResult.Items.Count - 1;
            }
        }
开发者ID:Yinzhe-Qi,项目名称:RPS,代码行数:30,代码来源:FormMainWindow.cs

示例14: imagem_MouseUp

        private void imagem_MouseUp(object sender, MouseEventArgs e)
        {
            if (box)
            {
                box = false;
                p2 = e.Location;
                if (p2.X - p1.X < 0) return;
                if (p2.Y - p1.Y < 0) return;
                if (p1 == p2)
                {

                    Rectangle rtest;
                    Point pt1, pt2;
                    int i = 0;
                    foreach (Box boxp in lista_box)
                    {
                        pt1 = boxp.P1;
                        pt2 = boxp.P2;
                        rtest = new Rectangle(pt1.X, pt1.Y, pt2.X - pt1.X, pt2.Y - pt1.Y);

                        if(rtest.Contains(p1))
                        {
                             lista.SelectedIndex = i;
                        }
                        i++;
                    }
                    return;
                }

                imagem.Invalidate();

                lista_box.Add(new Box(p1, p2));

                lista.Items.Add(p1.ToString() + " - " + p2.ToString());

                lista.SelectedIndex = lista_box.Count - 1;
            }
        }
开发者ID:jrbitt,项目名称:libEGL,代码行数:38,代码来源:Form1.cs

示例15: b_adjust_bot_Click

        private void b_adjust_bot_Click(object sender, EventArgs e)
        {
            Point found_point = divideAndConquerSearch(0, 500);

            if(found_point == FAIL_POINT)
            {
                writeToLog(module_name, "Could not adjust Bot!");
                return;
            }

            Point to_match = new Point(607, 585);

            Point adjust_point_p = new Point(found_point.X - to_match.X, found_point.Y - to_match.Y);

            if (Tools.adjust_bot_point == adjust_point_p)
            {
                writeToLog(module_name, "Bot was correctly adjusted.");
            }
            else
            {
                MyXML xml = new MyXML(config_path);
                xml.write(adjust_point_x, adjust_point_p.X.ToString());
                xml.write(adjust_point_y, adjust_point_p.Y.ToString());
                Tools.adjust_bot_point = adjust_point_p;

                writeToLog(module_name, "Bot correctly adjusted from " + Tools.adjust_bot_point.ToString() + " to " + adjust_point_p.ToString() + ".");
            }

            BackgroundWorker bgw = new BackgroundWorker();
            bgw.DoWork += new DoWorkEventHandler(AsyncAdjustPixelColors);
            bgw.RunWorkerAsync();
        }
开发者ID:WildGenie,项目名称:D3_Bot_Tool,代码行数:32,代码来源:main.cs


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