當前位置: 首頁>>代碼示例>>C#>>正文


C# PointF.ToString方法代碼示例

本文整理匯總了C#中System.Drawing.PointF.ToString方法的典型用法代碼示例。如果您正苦於以下問題:C# PointF.ToString方法的具體用法?C# PointF.ToString怎麽用?C# PointF.ToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Drawing.PointF的用法示例。


在下文中一共展示了PointF.ToString方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: AssertAlmostEqual

		public static void AssertAlmostEqual (PointF expected, PointF actual)
		{
			string msg = String.Format("\nExpected : {0} \n  Actual : {1}",expected.ToString(),actual.ToString());
			AssertAlmostEqual (expected.X, actual.X, DEFAULT_FLOAT_TOLERANCE, msg);
			AssertAlmostEqual (expected.Y, actual.Y, DEFAULT_FLOAT_TOLERANCE, msg);
		}
開發者ID:kumpera,項目名稱:mono,代碼行數:6,代碼來源:DrawingTest.cs

示例2: OnPaint

		protected override void OnPaint(PaintEventArgs e)
		{
			Graphics g = e.Graphics;
			
			PointF drawPoint = new PointF(0.0f, 0.0f);

			using( Brush brush = new SolidBrush(ForeColor) )
			{
				StringFormat format = StringFormat.GenericTypographic;
				SizeF size = g.MeasureString(Text, Font);
				g.DrawString( Text, Font, brush, drawPoint, format );

				foreach(string item in items)
				{
					string str = BulletCharacter + " " + item;
					drawPoint.Y += size.Height;// + (float) Font.FontFamily.GetLineSpacing(Font.Style);
					size = g.MeasureString(str, Font);
					System.Diagnostics.Trace.WriteLine(drawPoint.ToString());
					g.DrawString( str, Font, brush, drawPoint, format);
				}
			}
		}
開發者ID:TEGUHRI,項目名稱:messagingtoolkit-smartgateway,代碼行數:22,代碼來源:BulletList.cs

示例3: NearXRoad

        private Road NearXRoad()
        {
            Road[] roadz = Map.Roads.Where(r => r != _road && !r.SensAngle.Equals(_angle)).ToArray();
            //StrucRectangle sr = new StrucRectangle(PosX, PosX, Length, Height);

            //Road ro = roadz.FirstOrDefault(road => road.StructRect.IntersectsWith(sr));
            Road ro = null;

            //foreach (Road road in roadz)
            //{
            //    //if (road.StructRect.IntersectsWith(this.RectF))
            //    if (IsOverRoad(road))
            //    {
            //        ro = road;
            //        break;
            //    }
            //}

            //if (ro != null)
            //    Debug.WriteLine("its okay ;)");

            PointF middle = new PointF((float)((this.PosX + this._height) / 2), (float)((this.PosX - this._height) / 2));

            Debug.WriteLine(middle.ToString());
            if (XRoad.Rect.Contains(new Point(PosX, PosY)))
            {
                Debug.WriteLine("ok bro");

                ro = roadz.ElementAt(0);
                if (PosY < XRoad.Rect.Top + XRoad.Rect.Height)
                    ro = roadz.ElementAt(1);
            }

            return ro;
        }
開發者ID:conanedogawa2,項目名稱:multiagent,代碼行數:35,代碼來源:Car.cs

示例4: PerformToStringTest

		private void PerformToStringTest(CultureInfo culture)
		{
			// set current culture
			Thread.CurrentThread.CurrentCulture = culture;

			// perform tests
			Assert.AreEqual (GetExpectedToString (culture, pt0_11), pt0_11.ToString (),
				"TS#1-" + culture.Name);
			Assert.AreEqual (GetExpectedToString (culture, pt11_0), pt11_0.ToString (),
				"TS#2-" + culture.Name);
			Assert.AreEqual (GetExpectedToString (culture, pt11_99), pt11_99.ToString (),
				"TS#3-" + culture.Name);
			PointF pt = new PointF (float.NaN, float.NegativeInfinity);
			Assert.AreEqual (GetExpectedToString (culture, pt), pt.ToString (),
				"TS#4-" + culture.Name);
		}
開發者ID:nlhepler,項目名稱:mono,代碼行數:16,代碼來源:TestPointF.cs

示例5: frm3DSurfaceGraphViewer_MouseDown

        private void frm3DSurfaceGraphViewer_MouseDown(object sender, MouseEventArgs e)
        {
            /*if (e.Button == MouseButtons.Left)
            {
                // rotate
                this.Cursor = GenerateCursor("Turn");
            }
            else if (e.Button == MouseButtons.Right)
            {
                // pan
                this.Cursor = GenerateCursor("Pan");
            }
            m_IsDragging = true;
            m_p = e.Location;
            //Invalidate();*/
            double d = 0.0;
            PointF p = new PointF();
            bool b = sr.GetMousePoint(e.X, e.Y, out p, out d);
            string s = b.ToString() + " | " + p.ToString() + " | " + d.ToString();

            // if (b) System.Diagnostics.Debug.Write("\nMouseDown: " + s + "\n");

            if (e.Button == MouseButtons.Left)
            {
                // rotate
                this.Cursor = GenerateCursor("Turn");
            }
            else if (e.Button == MouseButtons.Right)
            {
                // pan
                this.Cursor = GenerateCursor("Pan");
            }
            m_IsDragging = true;
            m_p = e.Location;
        }
開發者ID:ChrisPea,項目名稱:TuningSuites,代碼行數:35,代碼來源:SurfaceGraphViewer.cs


注:本文中的System.Drawing.PointF.ToString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。