當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。