.NET Windows Forms in a Nutshell

SizeF serializable

System.Drawing (system.drawing.dll) struct

A member of the family of basic geometry types, this value is the floating-point equivalent of the integer-based Size structure.

It provides all the functionality of the integer version, plus a ToSize() member, which uses truncation to perform the conversion.

public struct SizeF { // Public Constructors public SizeF (PointF pt ); public SizeF (float width , float height ); public SizeF (SizeF size ); // Public Static Fields public static readonly SizeF Empty ; // = {Width=0, Height=0} // Public Instance Properties public float Height {set; get; } public bool IsEmpty {get; } public float Width {set; get; } // Public Static Methods public static SizeF operator - (SizeF sz1 , SizeF sz2 ); public static SizeF operator + (SizeF sz1 , SizeF sz2 ); public static bool operator != (SizeF sz1 , SizeF sz2 ); public static bool operator == (SizeF sz1 , SizeF sz2 ); public static explicit operator PointF (SizeF size ); // Public Instance Methods public override bool Equals (object obj ); // overrides ValueType public override int GetHashCode (); // overrides ValueType public PointF ToPointF (); public Size ToSize (); public override string ToString (); // overrides ValueType }

Hierarchy

System.Object System.ValueType SizeF

Returned By

Graphics.MeasureString() , Image.PhysicalDimension , RectangleF.Size , System.Windows.Forms.Form.GetAutoScaleSize()

Passed To

Graphics.MeasureString() , RectangleF.{Inflate() , RectangleF() , Size} , Size.{Ceiling() , Round() , Truncate()}

Категории