RectangleF is a class in the C# System.Drawing library which represents a rectangle with floating point values for the coordinates and dimensions. It is used for any situation where the coordinates or dimensions require fractional values.
Example 1: Creating a RectangleF object with values
RectangleF rect = new RectangleF(10.5f, 20.25f, 30.75f, 40.5f);
This code creates a RectangleF object called rect with the values x=10.5, y=20.25, width=30.75, and height=40.5.
Example 2: Checking if a point is within a RectangleF object
RectangleF rect = new RectangleF(10.5f, 20.25f, 30.75f, 40.5f); PointF point = new PointF(25.0f, 35.0f); bool isPointInRect = rect.Contains(point);
This code creates a RectangleF object called rect and a PointF object called point. It then checks if point is within rect and stores the result in a bool called isPointInRect.
Package/library: System.Drawing.
C# (CSharp) RectangleF - 60 examples found. These are the top rated real world C# (CSharp) examples of RectangleF from package runtime extracted from open source projects. You can rate examples to help us improve the quality of examples.