RectangleF rect = new RectangleF(x, y, width, height);
PointF point = new PointF(x, y); if (rect.Contains(point)) { // Do something if the point is inside the rectangle }
float scaleFactor = 1.2f; RectangleF scaledRect = new RectangleF(rect.X * scaleFactor, rect.Y * scaleFactor, rect.Width * scaleFactor, rect.Height * scaleFactor);This code scales a given rectangle by a factor of 1.2 along both the x and y axes. It creates a new RectangleF instance with the updated size and position. The package library for the System.Drawing RectangleF class is the .NET framework's built-in System.Drawing library. It is a part of the System.Drawing.dll assembly, which contains classes for working with various image file formats, graphics rendering, and more.