Add size and point : Rectangle « 2D Graphics « C# / C Sharp






Add size and point

Add size and point

using System;
using System.Drawing;

class Class1 {
    static void Main(string[] args) {
        Point topLeft = new Point(10,10);
        Size rectangleSize = new Size(50,50);
        Point bottomRight = topLeft + rectangleSize;
        Console.WriteLine("topLeft = " + topLeft);
        Console.WriteLine("bottomRight = " + bottomRight);
        Console.WriteLine("Size = " + rectangleSize);
    }
}

           
       








Related examples in the same category

1.Work with Rectangle type
2.Simplest code to draw a RectangleSimplest code to draw a Rectangle
3.Draw SquareDraw Square
4.Draw RectangleDraw Rectangle