IRONSOFTWAREHOME
Rectangle & RectangleF
using IronSoftware.Drawing;

// Instantiate Rectangle
Rectangle rectangle = new Rectangle(5, 5, 50, 50);

// Instantiate RectangleF
RectangleF rectangleF = new RectangleF(8.5F, 5.5F, 120F, 85F);

NuGet Download
PM > Install-Package IronSoftware.System.Drawing
Rectangle & RectangleF

Rectangle & RectangleF

IronDrawing provides two classes that allow you to draw a rectangle at particular coordinates: IronSoftware.Drawing.Rectangle and IronSoftware.Drawing.RectangleF. These classes contain a set of four parameters that represent the location and size of the rectangle drawn.

These classes take x and y coordinates from the top-left corner of the rectangle. The Rectangle class uses int types for these coordinates, while the RectangleF class uses float types. The last two parameters represent the width and height of the rectangle, using the same data types as indicated for the x and y coordinate parameters. The default unit for both classes is pixels.

View on GitHub

Ready to Get Started?

Nuget Downloads 20,274,271Version:2025.3just released

Key in blue circle

Get your free 30-day Trial Key instantly

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronDrawing
Get a Quote, No Obligation
Your details will always be kept confidential.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Trusted by Millions of Engineers Worldwide
Get your free 30-day Trial Key instantly.
No credit card or account creation required