当前位置: 首页>>代码示例>>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;未经允许,请勿转载。