124 instantiations of SizeF
Accessibility_Core_App (13)
CommonControl1.Designer.cs (1)
679this.AutoScaleDimensions = new System.Drawing.SizeF(13F, 32F);
CommonControl2.Designer.cs (1)
258this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
ContainerControls.Designer.cs (1)
800this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
ContainerControls2.Designer.cs (1)
417this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
DataBindingExample.Designer.cs (1)
271this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
DataControls.Designer.cs (1)
349this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
DialogControls.Designer.cs (1)
82this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
Main.Designer.cs (1)
166this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
Menu_Toolbars_controls.Designer.cs (1)
592AutoScaleDimensions = new SizeF(8F, 20F);
MenuForm.Designer.cs (1)
59this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
PrintingControls.Designer.cs (1)
159this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
RemainingControls.Designer.cs (1)
116this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
ToolStripContainer.Designer.cs (1)
591this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
BinaryFormatTests (4)
FormatTests\FormattedObject\BinaryFormatWriterTests.cs (4)
199new SizeF(7F, 8F), 200new SizeF(float.MaxValue, float.MinValue), 201new SizeF(-float.MaxValue, float.PositiveInfinity), 202new SizeF(0, 0),
DesignSurface (1)
MainForm.Designer.cs (1)
294this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
NativeHost.ManagedControl (1)
ManagedControl.Designer.cs (1)
48this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
PresentationUI (11)
MS\Internal\Documents\Application\DocumentPropertiesDialog.Designer.cs (1)
726this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
MS\Internal\Documents\CredentialManagerDialog.Designer.cs (1)
160this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
MS\Internal\Documents\RequestedSignatureDialog.Designer.cs (1)
216AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
MS\Internal\Documents\RMEnrollmentPage1.Designer.cs (1)
205AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
MS\Internal\Documents\RMEnrollmentPage2.Designer.cs (1)
209this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
MS\Internal\Documents\RMEnrollmentPage3.Designer.cs (1)
120this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
MS\Internal\Documents\RMPermissions.Designer.cs (1)
182this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
MS\Internal\Documents\RMPublishingDialog.Designer.cs (1)
369this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
MS\Internal\Documents\SignatureSummaryDialog.Designer.cs (1)
202AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
MS\Internal\Documents\SigningDialog.Designer.cs (1)
254AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
MS\Internal\Documents\SigningProgress.Designer.cs (1)
55AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
System.ComponentModel.TypeConverter (2)
System\Drawing\SizeFConverter.cs (2)
52return new SizeF(values[0], values[1]); 102return new SizeF((float)width, (float)height);
System.Drawing.Common.Tests (9)
mono\System.Drawing\GraphicsTests.cs (2)
1785? g.MeasureString(s.AsSpan(), _font, new SizeF(80, size.Height), null, out int chars, out int lines) 1786: g.MeasureString(s, _font, new SizeF(80, size.Height), null, out chars, out lines);
System\Drawing\Drawing2D\GraphicsPathTests.cs (1)
2386path.AddRoundedRectangle(new RectangleF(10, 10, 20, 20), new(5, 5));
System\Drawing\GraphicsTests.cs (2)
2983graphics.DrawRoundedRectangle(Pens.Red, new RectangleF(0, 0, 10, 10), new(2, 2)); 3001graphics.FillRoundedRectangle(Brushes.Green, new RectangleF(0, 0, 10, 10), new(2, 2));
System\Drawing\IconConverterTests.cs (2)
116Assert.Throws<NotSupportedException>(() => _icoConv.ConvertFrom(null, CultureInfo.InvariantCulture, new SizeF(10, 10))); 128Assert.Throws<NotSupportedException>(() => _icoConvFrmTD.ConvertFrom(null, CultureInfo.InvariantCulture, new SizeF(10, 10)));
System\Drawing\ImageConverterTests.cs (2)
143Assert.Throws<NotSupportedException>(() => _imgConv.ConvertFrom(null, CultureInfo.InvariantCulture, new SizeF(10, 10))); 150Assert.Throws<NotSupportedException>(() => _imgConvFrmTD.ConvertFrom(null, CultureInfo.InvariantCulture, new SizeF(10, 10)));
System.Drawing.Primitives (9)
System\Drawing\RectangleF.cs (1)
105readonly get => new SizeF(Width, Height);
System\Drawing\Size.cs (3)
47public static implicit operator SizeF(Size p) => new SizeF(p.Width, p.Height); 106=> new SizeF(left.width / right, left.height / right); 210new SizeF(size.width * multiplier, size.height * multiplier);
System\Drawing\SizeF.cs (5)
77public static explicit operator SizeF(Vector2 vector) => new SizeF(vector); 112=> new SizeF(left.width / right, left.height / right); 156public static SizeF Add(SizeF sz1, SizeF sz2) => new SizeF(sz1.Width + sz2.Width, sz1.Height + sz2.Height); 161public static SizeF Subtract(SizeF sz1, SizeF sz2) => new SizeF(sz1.Width - sz2.Width, sz1.Height - sz2.Height); 189new SizeF(size.width * multiplier, size.height * multiplier);
System.Private.Windows.Core (1)
System\Private\Windows\Core\Nrbf\SerializationRecordExtensions.cs (1)
229value = new SizeF(classInfo.GetSingle("width"), classInfo.GetSingle("height"));
System.Windows.Forms (14)
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.LayoutOptions.cs (1)
671screen.Graphics.MeasureString(Text, Font, new SizeF(proposedSize.Width, proposedSize.Height),
System\Windows\Forms\Controls\Labels\Label.cs (2)
1083new SizeF(0, proposedConstraints.Height) : 1084new SizeF(proposedConstraints.Width, proposedConstraints.Height);
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.MeasureTextHelper.cs (2)
16=> MeasureTextSimple(owner, g, text, font, new SizeF(0, 0)); 19=> MeasureText(owner, g, text, font, new SizeF(width, 999999));
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridErrorDialog.cs (1)
265AutoScaleDimensions = new SizeF(7F, 15F);
System\Windows\Forms\Form.cs (1)
3746return new SizeF(width, height);
System\Windows\Forms\Layout\Containers\ContainerControl.cs (6)
84internal SizeF _currentAutoScaleFactor = new(1F, 1F); 151? new(1.0F, 1.0F) 152: new(currentAutoScaleDimensions.Width / savedAutoScaleDimensions.Width, currentAutoScaleDimensions.Height / savedAutoScaleDimensions.Height); 333currentAutoScaleDimensions = new SizeF(_deviceDpi, _deviceDpi); 338currentAutoScaleDimensions = new SizeF(ScaleHelper.InitialSystemDpi, ScaleHelper.InitialSystemDpi); 678return parentControl is ContainerControl container ? container._currentAutoScaleFactor : new SizeF(1F, 1F);
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutPanel.cs (1)
488ScaleAbsoluteStyles(new SizeF(dx, dy));
System.Windows.Forms.Design (4)
System\Windows\Forms\Design\BorderSidesEditor.BorderSidesEditorUI.cs (1)
162AutoScaleDimensions = new SizeF(6F, 13F);
System\Windows\Forms\Design\DataGridViewCellStyleBuilder.cs (1)
238AutoScaleDimensions = new Drawing.SizeF(6F, 13F);
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (1)
1004int textWidth = Size.Ceiling(e.Graphics.MeasureString(columnName, e.Font!, new SizeF(bounds.Width, bounds.Height))).Width;
System\Windows\Forms\Design\FormatStringDialog.cs (1)
203AutoScaleDimensions = new Drawing.SizeF(6, 13);
System.Windows.Forms.Tests (15)
System\Windows\Forms\BinaryFormatUtilitiesTests.cs (2)
127new SizeF(float.MaxValue, float.MinValue), 906public SizeF SizeF = new(1, 2);
System\Windows\Forms\ContainerControlTests.cs (3)
28Assert.Equal(new SizeF(1, 1), control.AutoScaleFactor); 240yield return new object[] { AutoScaleMode.Dpi, new SizeF(96, 96) }; 250AutoScaleDimensions = new SizeF(1, 2),
System\Windows\Forms\Design\ComponentEditorFormTests.cs (1)
34Assert.Equal(new SizeF(1, 1), control.AutoScaleFactor);
System\Windows\Forms\DomainUpDownTests.cs (1)
37_sub.AutoScaleFactor.Should().Be(new SizeF(1, 1));
System\Windows\Forms\FormTests.cs (1)
32Assert.Equal(new SizeF(1, 1), control.AutoScaleFactor);
System\Windows\Forms\PropertyGridTests.cs (1)
33Assert.Equal(new SizeF(1, 1), control.AutoScaleFactor);
System\Windows\Forms\ScrollableControlTests.cs (2)
2196control.Scale(new SizeF(10, 20)); 2209control.Scale(new SizeF(10, 20));
System\Windows\Forms\ScrollBarTests.cs (1)
2597SizeF factor = new(((float)deviceDpiNew) / deviceDpiOld, ((float)deviceDpiNew) / deviceDpiOld);
System\Windows\Forms\ToolStripPanelTests.cs (1)
25Assert.Equal(new SizeF(1, 1), control.AutoScaleFactor);
System\Windows\Forms\UpDownBaseTests.cs (1)
23Assert.Equal(new SizeF(1, 1), control.AutoScaleFactor);
System\Windows\Forms\UserControlTests.cs (1)
29Assert.Equal(new SizeF(1, 1), control.AutoScaleFactor);
TrimTest (1)
Form1.Designer.cs (1)
98AutoScaleDimensions = new SizeF(7F, 15F);
TrimTestBinaryDeserialization (1)
Form1.Designer.cs (1)
58AutoScaleDimensions = new SizeF(7F, 15F);
WindowsFormsIntegration (1)
System\Windows\Integration\WindowsFormsHost.cs (1)
185Child.Scale(new System.Drawing.SizeF((float)(newScale.X / _currentScale.X), (float)(newScale.Y / _currentScale.Y)));
WinFormsControlsTest (37)
AnchorLayoutTests.Designer.cs (1)
138this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 25F);
Buttons.Designer.cs (1)
44this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
Calendar.Designer.cs (1)
232this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
ChartControl.Designer.cs (1)
413this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F);
ComboBoxes.Designer.cs (1)
266this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
ComboBoxesWithScrollBars.Designer.cs (1)
347this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
DataGridViewInVirtualModeTest.Designer.cs (1)
83this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
DataGridViewTest.Designer.cs (1)
207this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
DateTimePicker.Designer.cs (1)
95this.AutoScaleDimensions = new SizeF(7F, 15F);
DesignTimeAligned.Designer.cs (1)
94this.AutoScaleDimensions = new System.Drawing.SizeF(192F, 192F);
Dialogs.Designer.cs (1)
148this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
DockLayoutTests.Designer.cs (1)
95this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 25F);
DragDrop.Designer.cs (1)
197AutoScaleDimensions = new SizeF(7F, 15F);
ErrorProviderTest.Designer.cs (1)
128this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
FormBorderStyles.Designer.cs (1)
55this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
ListBoxes.Designer.cs (1)
200this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
MainForm.Designer.cs (1)
48this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
MdiChild.Designer.cs (1)
140this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
MdiParent.Designer.cs (1)
38this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
MediaPlayer.Designer.cs (1)
53this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
MenuStripAndCheckedListBox.Designer.cs (1)
283this.AutoScaleDimensions = new System.Drawing.SizeF(192F, 192F);
MessageBoxes.Designer.cs (1)
51this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
MultipleControls.Designer.cs (1)
299this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
Password.Designer.cs (1)
237AutoScaleDimensions = new SizeF(8F, 20F);
PictureBoxes.Designer.cs (1)
81this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
PropertyGrid.Designer.cs (1)
49this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
RichTextBoxes.Designer.cs (1)
62this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
ScalingBeforeChanges.cs (1)
102checkBox1.Scale(new SizeF(factorX, factorY));
ScalingBeforeChanges.Designer.cs (1)
49this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
ScrollableControls.Designer.cs (1)
436AutoScaleDimensions = new SizeF(7F, 15F);
ScrollBars.Designer.cs (1)
135this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
Splitter.Designer.cs (1)
60this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F);
TextBoxes.Designer.cs (1)
151this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
ToolStripSeparatorPreferredSize.cs (1)
85AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
ToolStripTests.Designer.cs (1)
435this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
ToolTipTests.Designer.cs (1)
159this.AutoScaleDimensions = new System.Drawing.SizeF(17F, 41F);
TrackBars.Designer.cs (1)
247this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
301 references to SizeF
BinaryFormatTests (1)
FormatTests\FormattedObject\BinaryFormattedTypes.cs (1)
55typeof(SizeF),
Microsoft.VisualBasic.Forms (1)
Microsoft\VisualBasic\Helpers\VBInputBox.vb (1)
93Dim labelSizeNeeded As SizeF = labelGraphics.MeasureString(prompt, Label.Font, Label.Width)
netstandard (1)
netstandard.cs (1)
756[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.SizeF))]
PresentationCore.Tests (1)
BinaryFormat\BinaryFormattedTypes.cs (1)
56typeof(SizeF),
System.ComponentModel.TypeConverter (3)
System\Drawing\SizeFConverter.cs (3)
62if (value is SizeF size) 79ConstructorInfo? ctor = typeof(SizeF).GetConstructor(new Type[] { typeof(float), typeof(float) }); 112PropertyDescriptorCollection props = TypeDescriptor.GetProperties(typeof(SizeF), attributes);
System.Data.Common (1)
System\Data\TypeLimiter.cs (1)
180typeof(SizeF),
System.Drawing (1)
System.Drawing.cs (1)
145[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.SizeF))]
System.Drawing.Common (11)
Special\NotSupported.cs (11)
643public System.Drawing.SizeF MeasureString(string? text, System.Drawing.Font font) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 644public System.Drawing.SizeF MeasureString(string? text, System.Drawing.Font font, System.Drawing.PointF origin, System.Drawing.StringFormat? stringFormat) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 645public System.Drawing.SizeF MeasureString(string? text, System.Drawing.Font font, System.Drawing.SizeF layoutArea) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 646public System.Drawing.SizeF MeasureString(string? text, System.Drawing.Font font, System.Drawing.SizeF layoutArea, System.Drawing.StringFormat? stringFormat) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 647public System.Drawing.SizeF MeasureString(string? text, System.Drawing.Font font, System.Drawing.SizeF layoutArea, System.Drawing.StringFormat? stringFormat, out int charactersFitted, out int linesFilled) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 648public System.Drawing.SizeF MeasureString(string? text, System.Drawing.Font font, int width) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 649public System.Drawing.SizeF MeasureString(string? text, System.Drawing.Font font, int width, System.Drawing.StringFormat? format) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 758public System.Drawing.SizeF PhysicalDimension { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } }
System.Drawing.Common.Tests (38)
mono\System.Drawing\GraphicsTests.cs (29)
1575SizeF size = g.MeasureString(null, _font); 1605SizeF size = g.MeasureString("a", _font, SizeF.Empty); 1608size = g.MeasureString("a".AsSpan(), _font, SizeF.Empty); 1611size = g.MeasureString(string.Empty, _font, SizeF.Empty); 1614size = g.MeasureString(string.Empty.AsSpan(), _font, SizeF.Empty); 1622SizeF size0 = useSpan ? g.MeasureString(s.AsSpan(), _font, 0) : g.MeasureString(s, _font, 0); 1623SizeF sizeN = useSpan ? g.MeasureString(s.AsSpan(), _font, int.MinValue) : g.MeasureString(s, _font, int.MinValue); 1624SizeF sizeP = useSpan ? g.MeasureString(s.AsSpan(), _font, int.MaxValue) : g.MeasureString(s, _font, int.MaxValue); 1656SizeF near = useSpan 1661SizeF center = useSpan 1666SizeF far = useSpan 1689SizeF near = useSpan 1694SizeF center = useSpan 1699SizeF far = useSpan 1720SizeF near = useSpan 1725SizeF center = useSpan 1730SizeF far = useSpan 1753SizeF near = useSpan 1758SizeF center = useSpan 1763SizeF far = useSpan 1782SizeF size = useSpan ? g.MeasureString(s.AsSpan(), _font) : g.MeasureString(s, _font); 1784SizeF size2 = useSpan 1805SizeF size = useSpan ? g.MeasureString(s.AsSpan(), _font) : g.MeasureString(s, _font); 1810SizeF expected = useSpan ? g.MeasureString(s.AsSpan(), _font) : g.MeasureString(s, _font); 1900SizeF size = g.MeasureString(text, _font, new Point(0, 0), string_format); 1923SizeF size = useSpan 1966SizeF size = g.MeasureString(text, _font, new Point(0, 0), string_format); 2121SizeF sz = g.MeasureString(text, _font, 80, format);
mono\System.Imaging\MetafileTest.cs (1)
308SizeF size = g.MeasureString(text, test_font);
System\Drawing\IconConverterTests.cs (4)
45Assert.False(_icoConv.CanConvertFrom(null, typeof(SizeF)), "SizeF"); 58Assert.False(_icoConvFrmTD.CanConvertFrom(null, typeof(SizeF)), "TD SizeF"); 81Assert.False(_icoConv.CanConvertTo(null, typeof(SizeF)), "SizeF"); 99Assert.False(_icoConvFrmTD.CanConvertTo(null, typeof(SizeF)), "TD SizeF");
System\Drawing\ImageConverterTests.cs (4)
71Assert.False(_imgConv.CanConvertFrom(null, typeof(SizeF)), "SizeF"); 84Assert.False(_imgConvFrmTD.CanConvertFrom(null, typeof(SizeF)), "TD SizeF"); 103Assert.False(_imgConv.CanConvertTo(null, typeof(SizeF)), "SizeF"); 117Assert.False(_imgConvFrmTD.CanConvertTo(null, typeof(SizeF)), "TD SizeF");
System.Drawing.Primitives (99)
System\Drawing\PointF.cs (8)
94/// Translates a <see cref='System.Drawing.PointF'/> by a given <see cref='System.Drawing.SizeF'/> . 96public static PointF operator +(PointF pt, SizeF sz) => Add(pt, sz); 99/// Translates a <see cref='System.Drawing.PointF'/> by the negative of a given <see cref='System.Drawing.SizeF'/> . 101public static PointF operator -(PointF pt, SizeF sz) => Subtract(pt, sz); 128/// Translates a <see cref='System.Drawing.PointF'/> by a given <see cref='System.Drawing.SizeF'/> . 130public static PointF Add(PointF pt, SizeF sz) => new PointF(pt.X + sz.Width, pt.Y + sz.Height); 133/// Translates a <see cref='System.Drawing.PointF'/> by the negative of a given <see cref='System.Drawing.SizeF'/> . 135public static PointF Subtract(PointF pt, SizeF sz) => new PointF(pt.X - sz.Width, pt.Y - sz.Height);
System\Drawing\RectangleF.cs (3)
43public RectangleF(PointF location, SizeF size) 103public SizeF Size 242public void Inflate(SizeF size) => Inflate(size.Width, size.Height);
System\Drawing\Size.cs (16)
45/// Converts the specified <see cref='System.Drawing.Size'/> to a <see cref='System.Drawing.SizeF'/>. 47public static implicit operator SizeF(Size p) => new SizeF(p.Width, p.Height); 84/// Multiplies <see cref="Size"/> by a <see cref="float"/> producing <see cref="SizeF"/>. 88/// <returns>Product of type <see cref="SizeF"/>.</returns> 89public static SizeF operator *(float left, Size right) => Multiply(right, left); 92/// Multiplies <see cref="Size"/> by a <see cref="float"/> producing <see cref="SizeF"/>. 96/// <returns>Product of type <see cref="SizeF"/>.</returns> 97public static SizeF operator *(Size left, float right) => Multiply(left, right); 100/// Divides <see cref="Size"/> by a <see cref="float"/> producing <see cref="SizeF"/>. 104/// <returns>Result of type <see cref="SizeF"/>.</returns> 105public static SizeF operator /(Size left, float right) 156public static Size Ceiling(SizeF value) => 168public static Size Truncate(SizeF value) => new Size(unchecked((int)value.Width), unchecked((int)value.Height)); 173public static Size Round(SizeF value) => 204/// Multiplies <see cref="Size"/> by a <see cref="float"/> producing <see cref="SizeF"/>. 209private static SizeF Multiply(Size size, float multiplier) =>
System\Drawing\SizeF.cs (72)
16public struct SizeF : IEquatable<SizeF> 19/// Initializes a new instance of the <see cref='System.Drawing.SizeF'/> class. 21public static readonly SizeF Empty; 26/// Initializes a new instance of the <see cref='System.Drawing.SizeF'/> class from the specified 27/// existing <see cref='System.Drawing.SizeF'/>. 29public SizeF(SizeF size) 36/// Initializes a new instance of the <see cref='System.Drawing.SizeF'/> class from the specified 46/// Initializes a new instance of the <see cref='System.Drawing.SizeF'/> struct from the specified 56/// Creates a new <see cref="System.Numerics.Vector2"/> from this <see cref="System.Drawing.SizeF"/>. 61/// Initializes a new instance of the <see cref='System.Drawing.SizeF'/> class from the specified dimensions. 70/// Converts the specified <see cref="System.Drawing.SizeF"/> to a <see cref="System.Numerics.Vector2"/>. 72public static explicit operator Vector2(SizeF size) => size.ToVector2(); 75/// Converts the specified <see cref="System.Numerics.Vector2"/> to a <see cref="System.Drawing.SizeF"/>. 77public static explicit operator SizeF(Vector2 vector) => new SizeF(vector); 80/// Performs vector addition of two <see cref='System.Drawing.SizeF'/> objects. 82public static SizeF operator +(SizeF sz1, SizeF sz2) => Add(sz1, sz2); 85/// Contracts a <see cref='System.Drawing.SizeF'/> by another <see cref='System.Drawing.SizeF'/> 87public static SizeF operator -(SizeF sz1, SizeF sz2) => Subtract(sz1, sz2); 90/// Multiplies <see cref="SizeF"/> by a <see cref="float"/> producing <see cref="SizeF"/>. 93/// <param name="right">Multiplicand of type <see cref="SizeF"/>.</param> 94/// <returns>Product of type <see cref="SizeF"/>.</returns> 95public static SizeF operator *(float left, SizeF right) => Multiply(right, left); 98/// Multiplies <see cref="SizeF"/> by a <see cref="float"/> producing <see cref="SizeF"/>. 100/// <param name="left">Multiplicand of type <see cref="SizeF"/>.</param> 102/// <returns>Product of type <see cref="SizeF"/>.</returns> 103public static SizeF operator *(SizeF left, float right) => Multiply(left, right); 106/// Divides <see cref="SizeF"/> by a <see cref="float"/> producing <see cref="SizeF"/>. 108/// <param name="left">Dividend of type <see cref="SizeF"/>.</param> 110/// <returns>Result of type <see cref="SizeF"/>.</returns> 111public static SizeF operator /(SizeF left, float right) 115/// Tests whether two <see cref='System.Drawing.SizeF'/> objects are identical. 117public static bool operator ==(SizeF sz1, SizeF sz2) => sz1.Width == sz2.Width && sz1.Height == sz2.Height; 120/// Tests whether two <see cref='System.Drawing.SizeF'/> objects are different. 122public static bool operator !=(SizeF sz1, SizeF sz2) => !(sz1 == sz2); 125/// Converts the specified <see cref='System.Drawing.SizeF'/> to a <see cref='System.Drawing.PointF'/>. 127public static explicit operator PointF(SizeF size) => new PointF(size.Width, size.Height); 130/// Tests whether this <see cref='System.Drawing.SizeF'/> has zero width and height. 136/// Represents the horizontal component of this <see cref='System.Drawing.SizeF'/>. 145/// Represents the vertical component of this <see cref='System.Drawing.SizeF'/>. 154/// Performs vector addition of two <see cref='System.Drawing.SizeF'/> objects. 156public static SizeF Add(SizeF sz1, SizeF sz2) => new SizeF(sz1.Width + sz2.Width, sz1.Height + sz2.Height); 159/// Contracts a <see cref='System.Drawing.SizeF'/> by another <see cref='System.Drawing.SizeF'/>. 161public static SizeF Subtract(SizeF sz1, SizeF sz2) => new SizeF(sz1.Width - sz2.Width, sz1.Height - sz2.Height); 164/// Tests to see whether the specified object is a <see cref='System.Drawing.SizeF'/> with the same dimensions 165/// as this <see cref='System.Drawing.SizeF'/>. 167public override readonly bool Equals([NotNullWhen(true)] object? obj) => obj is SizeF && Equals((SizeF)obj); 169public readonly bool Equals(SizeF other) => this == other; 178/// Creates a human-readable string that represents this <see cref='System.Drawing.SizeF'/>. 183/// Multiplies <see cref="SizeF"/> by a <see cref="float"/> producing <see cref="SizeF"/>. 185/// <param name="size">Multiplicand of type <see cref="SizeF"/>.</param> 188private static SizeF Multiply(SizeF size, float multiplier) =>
System.Private.Windows.Core (6)
System\Private\Windows\Core\BinaryFormat\BinaryFormatWriter.cs (4)
235/// Writes a <see cref="SizeF"/> in binary format. 237public static void WriteSizeF(Stream stream, SizeF value) 242new ClassInfo(1, typeof(SizeF).FullName!, s_sizeMemberNames), 738case SizeF sizeF:
System\Private\Windows\Core\Nrbf\SerializationRecordExtensions.cs (2)
211/// Tries to get this object as a <see cref="SizeF"/>. 222|| !classInfo.TypeNameMatches(typeof(SizeF))
System.Windows.Forms (80)
System\Windows\Forms\ActiveX\AxHost.cs (1)
1155protected override Rectangle GetScaledBounds(Rectangle bounds, SizeF factor, BoundsSpecified specified) => bounds;
System\Windows\Forms\Control.cs (9)
5276protected virtual Rectangle GetScaledBounds(Rectangle bounds, SizeF factor, BoundsSpecified specified) 9525public void Scale(SizeF factor) 9565internal virtual void Scale(SizeF includedFactor, SizeF excludedFactor, Control requestingControl, bool causedByFontChanged = false) 9601internal void ScaleChildControls(SizeF includedFactor, SizeF excludedFactor, Control requestingControl, bool causedByFontChanged = false) 9650internal void ScaleControl(SizeF includedFactor, SizeF excludedFactor) 9700protected virtual void ScaleControl(SizeF factor, BoundsSpecified specified)
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (1)
1937protected override void ScaleControl(SizeF factor, BoundsSpecified specified)
System\Windows\Forms\Controls\GroupBox\GroupBox.cs (1)
632protected override void ScaleControl(SizeF factor, BoundsSpecified specified)
System\Windows\Forms\Controls\Labels\Label.cs (1)
1082SizeF bounds = (proposedConstraints.Width == 1) ?
System\Windows\Forms\Controls\Labels\LinkLabel.cs (1)
1060focusRectangle = new RectangleF(regionRectangles[0].Location, SizeF.Empty);
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (2)
1459protected override Rectangle GetScaledBounds(Rectangle bounds, SizeF factor, BoundsSpecified specified) 2069protected override void ScaleControl(SizeF factor, BoundsSpecified specified)
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.MeasureTextHelper.cs (6)
15public static SizeF MeasureText(PropertyGrid owner, Graphics g, string? text, Font font) 18public static SizeF MeasureText(PropertyGrid owner, Graphics g, string? text, Font font, int width) 21public static SizeF MeasureTextSimple(PropertyGrid owner, Graphics g, string? text, Font font, SizeF size) 31public static SizeF MeasureText(PropertyGrid owner, Graphics g, string? text, Font font, SizeF size)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (1)
1200SizeF textSize = PropertyGrid.MeasureTextHelper.MeasureText(OwnerGrid, graphics, text, font);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridErrorDialog.cs (1)
301SizeF sizef = PropertyGrid.MeasureTextHelper.MeasureText(_ownerGrid, g, _detailsButton.Text, _detailsButton.Font);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\HelpPane.cs (1)
90SizeF sizef = PropertyGrid.MeasureTextHelper.MeasureText(OwnerPropertyGrid, g, _titleLabel.Text, Font, width);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (1)
1071SizeF sizeF = PropertyGrid.MeasureTextHelper.MeasureText(OwnerGrid, g, gridEntry.PropertyLabel, Font);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (1)
614SizeF sizef = PropertyGrid.MeasureTextHelper.MeasureText(
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (1)
1494protected override void ScaleControl(SizeF factor, BoundsSpecified specified)
System\Windows\Forms\Form.cs (7)
447SizeF real = GetAutoScaleSize(Font); 2983SizeF newVarF = GetAutoScaleSize(Font); 3725public static SizeF GetAutoScaleSize(Font font) 4548SizeF currentAutoScaleDimensions = GetCurrentAutoScaleDimensions(fontwrapper.Handle); 4549SizeF autoScaleFactor = GetCurrentAutoScaleFactor(currentAutoScaleDimensions, AutoScaleDimensions); 5131protected override Rectangle GetScaledBounds(Rectangle bounds, SizeF factor, BoundsSpecified specified) 5147protected override void ScaleControl(SizeF factor, BoundsSpecified specified)
System\Windows\Forms\Layout\Containers\ContainerControl.cs (34)
36private SizeF _autoScaleDimensions = SizeF.Empty; 38private SizeF _currentAutoScaleDimensions = SizeF.Empty; 84internal SizeF _currentAutoScaleFactor = new(1F, 1F); 110public SizeF AutoScaleDimensions 134protected SizeF AutoScaleFactor 138SizeF current = CurrentAutoScaleDimensions; 139SizeF saved = AutoScaleDimensions; 149internal static SizeF GetCurrentAutoScaleFactor(SizeF currentAutoScaleDimensions, SizeF savedAutoScaleDimensions) 183_autoScaleDimensions = SizeF.Empty; 186_currentAutoScaleDimensions = SizeF.Empty; 307public SizeF CurrentAutoScaleDimensions 320internal SizeF GetCurrentAutoScaleDimensions(HFONT fontHandle) 322SizeF currentAutoScaleDimensions; 665private SizeF GetParentAutoScaleFactor() 707private unsafe SizeF GetFontAutoScaleDimensions(HFONT fontHandle) 709SizeF retval = SizeF.Empty; 829child.Scale(AutoScaleFactor, SizeF.Empty, this); 865_currentAutoScaleDimensions = SizeF.Empty; 969SizeF autoScaleFactor = AutoScaleFactor; 985SizeF included = includedBounds ? autoScaleFactor : SizeF.Empty; 986SizeF excluded = excludedBounds ? autoScaleFactor : SizeF.Empty; 1071internal override void Scale(SizeF includedFactor, SizeF excludedFactor, Control requestingControl, bool causedByFontChanged = false) 1084SizeF ourExcludedFactor = excludedFactor; 1085SizeF childIncludedFactor = includedFactor; 1107SizeF ourExternalContainerFactor = ourExcludedFactor; 1111ourExternalContainerFactor = SizeF.Empty;
System\Windows\Forms\Layout\Containers\SplitContainer.cs (1)
1751protected override void ScaleControl(SizeF factor, BoundsSpecified specified)
System\Windows\Forms\Layout\DefaultLayout.cs (1)
973public static void ScaleAnchorInfo(IArrangedElement element, SizeF factor)
System\Windows\Forms\MDI\MDIClient.cs (2)
209/// <see cref="ScaleControl(SizeF,BoundsSpecified)" /> to enforce a minimum and maximum size. 213protected override void ScaleControl(SizeF factor, BoundsSpecified specified)
System\Windows\Forms\OLE\DataObject.Composition.Binder.cs (2)
101typeof(Drawing.SizeF), 221|| typeof(T) == typeof(Drawing.SizeF)
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutPanel.cs (2)
494protected override void ScaleControl(SizeF factor, BoundsSpecified specified) 500private void ScaleAbsoluteStyles(SizeF factor)
System\Windows\Forms\Scrolling\ScrollableControl.cs (1)
724protected override void ScaleControl(SizeF factor, BoundsSpecified specified)
System\Windows\Forms\Scrolling\ScrollBar.cs (2)
137protected override void ScaleControl(SizeF factor, BoundsSpecified specified) 484protected override Rectangle GetScaledBounds(Rectangle bounds, SizeF factor, BoundsSpecified specified)
System.Windows.Forms.Design (10)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (3)
212SizeF sizeW = g.MeasureString(c.ToString(CultureInfo.CurrentCulture), _listBox.Font); 220SizeF size = g.MeasureString(GetDisplayText(item), _listBox.Font); 564SizeF sizeW = g.MeasureString(maxC.ToString(CultureInfo.CurrentCulture), _listBox.Font);
System\ComponentModel\Design\MultilineStringEditor.MultilineStringEditorUI.cs (1)
358SizeF size;
System\Windows\Forms\Design\DocumentDesigner.cs (2)
64private SizeF AutoScaleDimensions 75return SizeF.Empty;
System\Windows\Forms\Design\FormDocumentDesigner.cs (3)
65SizeF real = Form.GetAutoScaleSize(((Form)Component).Font); 262private static void ApplyAutoScaling(SizeF baseVar, Form form) 268SizeF newVarF = Form.GetAutoScaleSize(form.Font);
System\Windows\Forms\Design\ImageListImage.cs (1)
48public SizeF PhysicalDimension => Image.Size;
System.Windows.Forms.Tests (48)
System\Windows\Forms\BinaryFormatUtilitiesTests.cs (1)
906public SizeF SizeF = new(1, 2);
System\Windows\Forms\ComboBoxTests.cs (1)
2934public new void ScaleControl(SizeF factor, BoundsSpecified specified) => base.ScaleControl(factor, specified);
System\Windows\Forms\ContainerControlTests.cs (6)
27Assert.Equal(SizeF.Empty, control.AutoScaleDimensions); 56Assert.Equal(SizeF.Empty, control.CurrentAutoScaleDimensions); 239yield return new object[] { AutoScaleMode.None, SizeF.Empty }; 241yield return new object[] { AutoScaleMode.Inherit, SizeF.Empty }; 246public void ContainerControl_AutoScaleMode_SetWithCustomOldValue_ResetsAutoScaleDimensions(AutoScaleMode value, SizeF expectedAutoScaleDimensions) 1411public new SizeF AutoScaleFactor => base.AutoScaleFactor;
System\Windows\Forms\ControlTests.cs (1)
1214public new Rectangle GetScaledBounds(Rectangle bounds, SizeF factor, BoundsSpecified specified) => base.GetScaledBounds(bounds, factor, specified);
System\Windows\Forms\ControlTests.Methods.cs (11)
2429public void Control_GetScaledBounds_Invoke_ReturnsExpected(Rectangle bounds, SizeF factor, BoundsSpecified specified, Rectangle expected) 2475public void Control_GetScaledBounds_InvokeWithStyles_ReturnsExpected(Rectangle bounds, SizeF factor, BoundsSpecified specified, Rectangle expected) 2488public void Control_GetScaledBounds_InvokeWithSite_ReturnsExpected(Rectangle bounds, SizeF factor, BoundsSpecified specified, Rectangle expected) 2535public void Control_GetScaledBounds_InvokeWithInvalidDesignModeSite_ReturnsExpected(Rectangle bounds, SizeF factor, BoundsSpecified specified, Rectangle expected, object designerHost) 2602public void Control_GetScaledBounds_InvokeWithValidDesignModeSite_ReturnsExpected(Rectangle bounds, SizeF factor, BoundsSpecified specified, Rectangle expected) 2641public void Control_GetScaledBounds_InvokeTopLevel_ReturnsExpected(Rectangle bounds, SizeF factor, BoundsSpecified specified, Rectangle expected) 2691public void Control_GetScaledBounds_InvokeFixedWidth_ReturnsExpected(Rectangle bounds, SizeF factor, BoundsSpecified specified, Rectangle expected) 2741public void Control_GetScaledBounds_InvokeFixedHeight_ReturnsExpected(Rectangle bounds, SizeF factor, BoundsSpecified specified, Rectangle expected) 2791public void Control_GetScaledBounds_InvokeFixedWidthAndHeight_ReturnsExpected(Rectangle bounds, SizeF factor, BoundsSpecified specified, Rectangle expected) 2807public void Control_GetScaledBounds_InvokeFixedWidthAndHeightWithStyles_ReturnsExpected(Rectangle bounds, SizeF factor, BoundsSpecified specified, Rectangle expected) 10141public new Rectangle GetScaledBounds(Rectangle bounds, SizeF factor, BoundsSpecified specified) => base.GetScaledBounds(bounds, factor, specified);
System\Windows\Forms\Design\ComponentEditorFormTests.cs (3)
33Assert.Equal(SizeF.Empty, control.AutoScaleDimensions); 65Assert.Equal(SizeF.Empty, control.CurrentAutoScaleDimensions); 380public new SizeF AutoScaleFactor => base.AutoScaleFactor;
System\Windows\Forms\DomainUpDownTests.cs (3)
36_sub.AutoScaleDimensions.Should().Be(SizeF.Empty); 76_sub.CurrentAutoScaleDimensions.Should().Be(SizeF.Empty); 1464public new SizeF AutoScaleFactor => base.AutoScaleFactor;
System\Windows\Forms\FormTests.cs (3)
31Assert.Equal(SizeF.Empty, control.AutoScaleDimensions); 64Assert.Equal(SizeF.Empty, control.CurrentAutoScaleDimensions); 2690public new SizeF AutoScaleFactor => base.AutoScaleFactor;
System\Windows\Forms\ListBoxTests.cs (1)
6508public new void ScaleControl(SizeF factor, BoundsSpecified specified) => base.ScaleControl(factor, specified);
System\Windows\Forms\PropertyGridTests.cs (3)
32Assert.Equal(SizeF.Empty, control.AutoScaleDimensions); 76Assert.Equal(SizeF.Empty, control.CurrentAutoScaleDimensions); 4141public new SizeF AutoScaleFactor => base.AutoScaleFactor;
System\Windows\Forms\ScrollBarTests.cs (5)
1801public void ScrollBar_GetScaledBounds_Invoke_ReturnsExpected(Rectangle bounds, SizeF factor, BoundsSpecified specified, Rectangle expected) 1849public void ScrollBar_GetScaledBounds_InvokeVertical_ReturnsExpected(Rectangle bounds, SizeF factor, BoundsSpecified specified, Rectangle expected) 2597SizeF factor = new(((float)deviceDpiNew) / deviceDpiOld, ((float)deviceDpiNew) / deviceDpiOld); 3155public new Rectangle GetScaledBounds(Rectangle bounds, SizeF factor, BoundsSpecified specified) => base.GetScaledBounds(bounds, factor, specified); 3214public new Rectangle GetScaledBounds(Rectangle bounds, SizeF factor, BoundsSpecified specified) => base.GetScaledBounds(bounds, factor, specified);
System\Windows\Forms\TableLayoutPanelTests.cs (1)
2255public new void ScaleControl(SizeF factor, BoundsSpecified specified) => base.ScaleControl(factor, specified);
System\Windows\Forms\ToolStripPanelTests.cs (3)
24Assert.Equal(SizeF.Empty, control.AutoScaleDimensions); 52Assert.Equal(SizeF.Empty, control.CurrentAutoScaleDimensions); 357public new SizeF AutoScaleFactor => base.AutoScaleFactor;
System\Windows\Forms\UpDownBaseTests.cs (3)
22Assert.Equal(SizeF.Empty, control.AutoScaleDimensions); 63Assert.Equal(SizeF.Empty, control.CurrentAutoScaleDimensions); 3097public new SizeF AutoScaleFactor => base.AutoScaleFactor;
System\Windows\Forms\UserControlTests.cs (3)
28Assert.Equal(SizeF.Empty, control.AutoScaleDimensions); 56Assert.Equal(SizeF.Empty, control.CurrentAutoScaleDimensions); 1795public new SizeF AutoScaleFactor => base.AutoScaleFactor;