Subtract point and size : Point « 2D « C# / CSharp Tutorial






using System;
using System.Drawing;
using System.Windows.Forms;
class PaintHello
{
     public static void Main()
     {
            Size sz = new Size(12, 12);
            Point pt = new Point(20, 20);

            pt = pt+sz;
            MessageBox.Show("Addition :"+ pt.ToString());
            pt = pt-sz;
            MessageBox.Show("Subtraction :"+ pt.ToString());

            PointF ptf = pt;
            MessageBox.Show("PointF :"+ pt.ToString());

            sz = (Size)pt;
            MessageBox.Show("Size :"+ sz.Width.ToString() +","+ sz.Height.ToString() );

     }
}








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