Skip to Content
.NET Windows Forms in a Nutshell
book

.NET Windows Forms in a Nutshell

by Ian Griffiths, Matthew Adams
March 2003
Intermediate to advanced
896 pages
32h 35m
English
O'Reilly Media, Inc.
Content preview from .NET Windows Forms in a Nutshell

Name

RectangleF

Synopsis

This value type is the real equivalent of the integer-based Rectangle. Again, it defines a rectangular region of a 2D surface. It offers all the basic facilities of the Rectangle structure, and a conversion operator to convert from a Rectangle.

As with the Point / PointF pair, there is no intrinsic performance advantage in using the integer Rectangle, as all the Graphics painting methods are implemented in terms of the real version anyway (in the first release of the framework).

The same rendering issues also apply as for Rectangle-based shapes if you are not aligned to the pixel boundaries of the target device.


public struct RectangleF {

// Public Constructors

   public RectangleF(PointF location, SizeF size);

   public RectangleF(float x, float y, float width, float height);

// Public Static Fields

   public static readonly RectangleF Empty;  // = {X=0,Y=0,Width=0,Height=0}

                  // Public Instance Properties

   public float Bottom{get; }

   public float Height{set; get; }

   public bool IsEmpty{get; }

   public float Left{get; }

   public PointF Location{set; get; }

   public float Right{get; }

   public SizeF Size{set; get; }

   public float Top{get; }

   public float Width{set; get; }

   public float X{set; get; }

   public float Y{set; get; }

// Public Static Methods

   public static RectangleF FromLTRB(float left, float top, float right, float bottom);

   public static RectangleF Inflate(RectangleF rect, float x, float y);

   public static RectangleF Intersect(RectangleF a, RectangleF b); public static RectangleF ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Windows Forms 2.0 Programming

Windows Forms 2.0 Programming

Chris Sells, Michael Weinhardt
Pro C# 7: With .NET and .NET Core

Pro C# 7: With .NET and .NET Core

Andrew Troelsen, Philip Japikse

Publisher Resources

ISBN: 0596003382Supplemental ContentCatalog PageErrata