Createing PointF : Point « 2D « C# / CSharp Tutorial






using System;
using System.Drawing;
using System.Windows.Forms;
class PaintHello
{
     public static void Main()
     {
          Form form      = new Form();
          form.BackColor = Color.White;
          form.Paint    += new PaintEventHandler(MyPaintHandler);
   
          Application.Run(form);
     }
     static void MyPaintHandler(object objSender, PaintEventArgs pea)
     {
          Form     form = (Form)objSender;
          Graphics g = pea.Graphics;
   
          PointF pt = new PointF(50.0F, 50.0F);
          PointF newPoint = PointF.Empty;
          newPoint.X = 100.0F;
          newPoint.Y = 200.0F;

          Pen pn = new Pen(Color.Blue, 4);
          g.DrawLine(pn, pt, newPoint);
          pn.Dispose();
          g.Dispose();        


     }
}








27.4.Point
27.4.1.Create and offset a point
27.4.2.Overloaded Point operators: ==
27.4.3.Add point and size and copy to point
27.4.4.Concert Point to Size
27.4.5.Create a PointF from Point
27.4.6.Createing Point
27.4.7.Createing PointF
27.4.8.Point Ceiling, Round, Truncate
27.4.9.Subtract point and size