239 instantiations of PointF
PresentationCore (1)
System\Windows\Nrbf\SerializationRecordExtensions.cs (1)
50value = new PointF(classInfo.GetSingle("x"), classInfo.GetSingle("y"));
PresentationCore.Tests (3)
BinaryFormat\HashTableTests.cs (1)
240{ "Foo", new PointF() }
BinaryFormat\SystemDrawingTests.cs (2)
14PointF input = new(1.5f, 2.1f); 39new PointF(),
System.Drawing.Common.Tests (220)
mono\System.Drawing\GraphicsTests.cs (10)
2421Assert.Throws<ArgumentNullException>(() => g.DrawImage(null, new PointF(0, 0))); 2429g.DrawImage(bmp, new PointF(0, 0)); 2463new(0, 0), new(1, 1), new(2, 2) 2712PointF p = new(1, 1); 2719PointF p = new(1, 1); 2726PointF p = new(1, 1); 2733PointF p = new(1, 1); 2945ptf[i] = new PointF(i, i);
System\Drawing\Drawing2D\GraphicsPathTests.cs (178)
223gpfPointsloat.AddLine(new PointF(1, 1), new PointF(2, 2)); 241gpf.AddLine(new PointF(49, 157), new PointF(75, 196)); 242gpf.AddLine(new PointF(75, 196), new PointF(102, 209)); 246gpf.AddLine(new PointF(102, 209), new PointF(75, 196)); 259gpf.AddLines(new PointF[] { new(1, 1), new(2, 2) }); 268gpi.AddLines(new PointF[] { new(1, 1) }); 272gpf.AddLines(new PointF[] { new(1, 1) }); 373gpf.AddBezier(new PointF(1, 1), new PointF(2, 2), new PointF(3, 3), new PointF(4, 4)); 390gpf.AddBezier(new PointF(0, 0), new PointF(0, 0), new PointF(0, 0), new PointF(0, 0)); 394gpf.AddBezier(new PointF(0, 0), new PointF(0, 0), new PointF(0, 0), new PointF(0, 0)); 434yield return new object[] { new PointF[1] { new(1f, 1f) } }; 435yield return new object[] { new PointF[2] { new(1f, 1f), new(2f, 2f) } }; 436yield return new object[] { new PointF[3] { new(1f, 1f), new(2f, 2f), new(3f, 3f) } }; 517new PointF (37f, 185f), 518new PointF (99f, 185f), 519new PointF (161f, 159f), 520new PointF (223f, 185f), 521new PointF (285f, 54f), 526new PointF (37f, 185f), 527new PointF (47.33333f, 185f), 528new PointF (78.3333f, 189.3333f), 529new PointF (99f, 185f), 530new PointF (119.6667f, 180.6667f), 531new PointF (140.3333f, 159f), 532new PointF (161f, 159f), 533new PointF (181.6667f, 159f), 534new PointF (202.3333f, 202.5f), 535new PointF (223f, 185f), 536new PointF (243.6667f, 167.5f), 537new PointF (274.6667f, 75.8333f), 538new PointF (285f, 54f), 565yield return new object[] { new PointF[1] { new(1f, 1f) } }; 604() => gp.AddCurve(new PointF[2] { new(1f, 1f), new(2f, 2f) }, 0, segment, 0.5f)); 615() => gp.AddCurve(new PointF[3] { new(1f, 1f), new(0f, 20f), new(20f, 0f) }, 1, 2, 0.5f)); 630gpf.AddClosedCurve(new PointF[3] { new(1, 1), new(2, 2), new(3, 3) }); 644gpf.AddClosedCurve(new PointF[3] { new(1, 1), new(1, 1), new(1, 1) }); 646gpf.AddClosedCurve(new PointF[3] { new(1, 1), new(1, 1), new(1, 1) }); 658gpf.AddClosedCurve(new PointF[3] { new(1, 1), new(2, 2), new(3, 3) }, 0.5f); 688yield return new object[] { new PointF[1] { new(1f, 1f) } }; 689yield return new object[] { new PointF[2] { new(1f, 1f), new(2f, 2f) } }; 893gpf.AddPolygon(new PointF[3] { new(1, 1), new(2, 2), new(3, 3) }); 918gpf.AddPolygon(new PointF[3] { new(1, 1), new(2, 2), new(3, 3) }); 922gpf.AddPolygon(new PointF[3] { new(1, 1), new(2, 2), new(3, 3) }); 926gpf.AddPolygon(new PointF[3] { new(1, 1), new(2, 2), new(3, 3) }); 930gpf.AddPolygon(new PointF[3] { new(1, 1), new(2, 2), new(3, 3) }); 946yield return new object[] { new PointF[1] { new(1f, 1f) } }; 947yield return new object[] { new PointF[2] { new(1f, 1f), new(2f, 2f) } }; 998gpf.AddString("mono", FontFamily.GenericMonospace, 0, 10, new PointF(10f, 10f), StringFormat.GenericDefault); 1026gpf.AddString("mono", FontFamily.GenericMonospace, 0, -10, new PointF(10f, 10f), StringFormat.GenericDefault); 1058gpi.AddString(string.Empty, FontFamily.GenericMonospace, 0, 10, new PointF(10f, 10f), StringFormat.GenericDefault); 1069gp.AddString(null, FontFamily.GenericMonospace, 0, 10, new PointF(10f, 10f), StringFormat.GenericDefault)); 1652new PointF(0.5f, 0.5f), new PointF(3.5f, 0.5f), new PointF(3.5f, 3.5f), 1653new PointF(0.5f, 3.5f), new PointF(1.5f, 3.0f), new PointF(1.0f, 2.5f), 1654new PointF(3.0f, 2.5f), new PointF(2.5f, 3.0f), new PointF(2.5f, 1.0f), 1655new PointF(3.0f, 1.5f), new PointF(1.0f, 1.5f), new PointF(1.5f, 1.0f), 2073new PointF(1f, 1f), new PointF(2f, 2f) 2088new PointF(2.99990582f, 2.01370716f), new PointF(2.99984312f, 2.018276f), 2089new PointF(2.99974918f, 2.02284455f), new PointF(2.999624f, 2.027412f), 2104new PointF(1f, 1f), new PointF(2f, 2f), 2105new PointF(3f, 3f), new PointF(4f, 4f), 2121new PointF(1f, 1f), new PointF(1.16666663f, 1.16666663f), 2122new PointF(1.83333325f, 1.83333325f), new PointF(2f, 2f) 2146new PointF(1f, 1f), new PointF(3f, 1f), 2147new PointF(3f, 3f), new PointF(1f, 3f) 2172new PointF(2f, 2f), new PointF(2.99990582f, 2.01370716f), 2173new PointF(2.99984312f, 2.018276f), new PointF(2.99974918f, 2.02284455f), 2174new PointF(2.999624f, 2.027412f) 2189new PointF(1f, 1f), 2190new PointF(2f, 2f), 2191new PointF(3f, 3f) 2229new PointF(4.2f, 4.5f), new PointF(15.8f, 4.5f), 2230new PointF(10.0f, 16.1f), new PointF(10.4f, 14.8f), 2231new PointF(9.6f, 14.8f), new PointF(14.6f, 4.8f), 2232new PointF(15.0f, 5.5f), new PointF(5.0f, 5.5f), 2233new PointF(5.4f, 4.8f) 2260PointF fPoint = new(13.0f, 2.0f); 2288PointF fPoint = new(29.0f, 29.0f); 2354new(27.499994f, 10), 2355new(28.880707f, 9.999997f), 2356new(29.999996f, 11.119284f), 2357new(29.999998f, 12.499999f), 2358new(29.999998f, 12.499999f), 2359new(29.999998f, 12.5f), 2360new(29.999998f, 12.5f), 2361new(29.999998f, 27.499998f), 2362new(29.999998f, 28.88071f), 2363new(28.88071f, 29.999998f), 2364new(27.5f, 29.999998f), 2365new(12.500001f, 29.999998f), 2366new(11.119289f, 30), 2367new(10.000001f, 28.880713f), 2368new(10f, 27.5f), 2369new(9.999999f, 12.500001f), 2370new(9.999998f, 11.119289f), 2371new(11.119286f, 10.000001f), 2372new(12.499997f, 9.999999f), 2385new(27.499994f, 10), 2386new(28.880707f, 9.999997f), 2387new(29.999996f, 11.119284f), 2388new(29.999998f, 12.499999f), 2389new(29.999998f, 12.499999f), 2390new(29.999998f, 12.5f), 2391new(29.999998f, 12.5f), 2392new(29.999998f, 27.499998f), 2393new(29.999998f, 28.88071f), 2394new(28.88071f, 29.999998f), 2395new(27.5f, 29.999998f), 2396new(12.500001f, 29.999998f), 2397new(11.119289f, 30), 2398new(10.000001f, 28.880713f), 2399new(10f, 27.5f), 2400new(9.999999f, 12.500001f), 2401new(9.999998f, 11.119289f), 2402new(11.119286f, 10.000001f), 2403new(12.499997f, 9.999999f),
System\Drawing\Drawing2D\LinearGradientBrushTests.cs (4)
40using LinearGradientBrush brush = new(new PointF(float.NaN, float.NaN), new PointF(float.PositiveInfinity, float.NegativeInfinity), Color.Plum, Color.Red); 70Assert.Throws<OutOfMemoryException>(() => new LinearGradientBrush(new PointF(x, y), new PointF(x, y), Color.Fuchsia, Color.GhostWhite));
System\Drawing\Drawing2D\MatrixTests.cs (2)
424yield return new object[] { new Matrix(10, 20, 30, 40, 50, 60), 180, new PointF(10, 10), MatrixOrder.Prepend, new float[] { -10, -20, -30, -40, 850, 1260 }, null, false }; 425yield return new object[] { new Matrix(10, 20, 30, 40, 50, 60), 180, new PointF(10, 10), MatrixOrder.Append, new float[] { -10, -20, -30, -40, -30, -40 }, null, false };
System\Drawing\Drawing2D\PathGradientBrushTests.cs (5)
114path.AddLines(new PointF[] { new(1, 1) }); 219PointF centralPoint = new(float.MaxValue, float.MinValue); 220PointF defaultCentralPoint = new(10.5f, 16f); 899PointF point = new(2.5f, 3.4f); 945Assert.Equal(new PointF(10.5f, 16f), brush.CenterPoint);
System\Drawing\Graphics_DrawLineTests.cs (4)
30graphics.DrawLines(pen, new PointF[] { new(1.0f, 1.0f), new(1.0f, 10.0f), new(20.0f, 5.0f), new(25.0f, 30.0f) });
System\Drawing\Graphics_GetContextTests.Core.cs (9)
50Assert.Equal(new PointF(1, 2), offset); 54Assert.Equal(new PointF(1, 2), offset); 67Assert.Equal(new PointF(1, 2), offset); 72Assert.Equal(new PointF(1, 2), offset); 86Assert.Equal(new PointF(1, 2), offset); 91Assert.Equal(new PointF(1, 2), offset); 107Assert.Equal(new PointF(2, 4), offset); 112Assert.Equal(new PointF(2, 4), offset); 130Assert.Equal(new PointF(2, 4), offset);
System\Drawing\GraphicsTests.cs (6)
1788new PointF[] { new(0.5f, -1.5f), new Point(0, -1) } 1796new PointF[] { new(0.5f, -1.5f), new Point(0, -1) } 1841var points = new PointF[] { new(1, 1) }; 1854AssertExtensions.Throws<ArgumentException>(null, () => graphics.TransformPoints(destSpace, CoordinateSpace.World, new PointF[] { new(1, 1) })); 1865AssertExtensions.Throws<ArgumentException>(null, () => graphics.TransformPoints(CoordinateSpace.World, srcSpace, new PointF[] { new(1, 1) })); 2829PointF pointF = new(10.5f, 10.5f);
System\Drawing\RegionTests.cs (2)
1416AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.IsVisible(new PointF(1, 2))); 1420AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.IsVisible(new PointF(1, 2), s_graphic));
System.Drawing.Primitives (8)
System\Drawing\Point.cs (1)
79public static implicit operator PointF(Point p) => new PointF(p.X, p.Y);
System\Drawing\PointF.cs (5)
81public static explicit operator PointF(Vector2 vector) => new PointF(vector); 120public static PointF Add(PointF pt, Size sz) => new PointF(pt.X + sz.Width, pt.Y + sz.Height); 125public static PointF Subtract(PointF pt, Size sz) => new PointF(pt.X - sz.Width, pt.Y - sz.Height); 130public static PointF Add(PointF pt, SizeF sz) => new PointF(pt.X + sz.Width, pt.Y + sz.Height); 135public static PointF Subtract(PointF pt, SizeF sz) => new PointF(pt.X - sz.Width, pt.Y - sz.Height);
System\Drawing\RectangleF.cs (1)
91readonly get => new PointF(X, Y);
System\Drawing\SizeF.cs (1)
127public static explicit operator PointF(SizeF size) => new PointF(size.Width, size.Height);
System.Private.Windows.Core (1)
System\Private\Windows\Nrbf\SerializationRecordExtensions.cs (1)
180value = new PointF(classInfo.GetSingle("x"), classInfo.GetSingle("y"));
System.Private.Windows.Core.Tests (2)
System\Private\Windows\Ole\BinaryFormatUtilitiesTests.cs (2)
56new PointF(1, 2), 1009public PointF PointF = new(1, 2);
System.Windows.Forms (2)
System\Windows\Forms\ActiveX\AxHost.cs (1)
1090PointF pcont = new(sz.Width, sz.Height);
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (1)
1125PointF pcont = new(sz.Width, sz.Height);
System.Windows.Forms.Tests (1)
System\Resources\ResxDataNodeTests.cs (1)
90new PointF(1.0f, 2.0f),
System.Windows.Forms.UI.IntegrationTests (1)
DesignBehaviorsTests.cs (1)
327pe.Graphics.DrawString($"Design time \n{Control.Site?.Name} !", Control.Font, SystemBrushes.WindowText, new PointF(12, 12));
483 references to PointF
BinaryFormatTests (3)
FormatTests\FormattedObject\BinaryFormattedTypes.cs (1)
35typeof(PointF),
FormatTests\FormattedObject\BinaryFormatWriterTests.cs (1)
184default(PointF),
FormatTests\FormattedObject\HashTableTests.cs (1)
240{ "Foo", default(PointF) }
netstandard (1)
netstandard.cs (1)
750[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.PointF))]
PresentationCore (6)
System\Windows\BinaryFormat\BinaryFormatWriter.cs (4)
135/// Writes a <see cref="PointF"/> in binary format. 137public static void WritePointF(Stream stream, PointF value) 142new ClassInfo(1, typeof(PointF).FullName!, PointMemberNames), 564case PointF point:
System\Windows\Nrbf\SerializationRecordExtensions.cs (2)
32/// Tries to get this object as a <see cref="PointF"/>. 43|| !classInfo.TypeNameMatches(typeof(PointF))
PresentationCore.Tests (16)
BinaryFormat\BinaryFormattedTypes.cs (1)
36typeof(PointF),
BinaryFormat\SystemDrawingTests.cs (3)
14PointF input = new(1.5f, 2.1f); 19Assert.Equal(input.X, ((PointF)read!).X); 20Assert.Equal(input.Y, ((PointF)read).Y);
FluentAssertions\FluentAssertExtensions.cs (10)
19/// current <see cref="PointF"/>. 21public static PointFAssertions Should(this PointF actualValue) => new(actualValue); 65/// Asserts a <see cref="PointF"/> value approximates another value as close as possible. 71PointF expectedValue, 83/// Asserts that two <see cref="PointF"/> collections contain the same items in the same order 87public static AndConstraint<GenericCollectionAssertions<PointF>> BeApproximatelyEquivalentTo( 88this GenericCollectionAssertions<PointF> parent, 89IEnumerable<PointF> expectation, 95(PointF actual, PointF expected) =>
FluentAssertions\PointFAssertions.cs (2)
6public class PointFAssertions(PointF value) 8public PointF Subject { get; } = value;
System.Data.Common (1)
System\Data\TypeLimiter.cs (1)
176typeof(PointF),
System.Drawing (1)
System.Drawing.cs (1)
107[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.PointF))]
System.Drawing.Common (86)
Special\NotSupported.cs (86)
467public void DrawBezier(System.Drawing.Pen pen, System.Drawing.PointF pt1, System.Drawing.PointF pt2, System.Drawing.PointF pt3, System.Drawing.PointF pt4) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 469public void DrawBeziers(System.Drawing.Pen pen, System.Drawing.PointF[] points) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 471public void DrawClosedCurve(System.Drawing.Pen pen, System.Drawing.PointF[] points) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 472public void DrawClosedCurve(System.Drawing.Pen pen, System.Drawing.PointF[] points, float tension, System.Drawing.Drawing2D.FillMode fillmode) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 475public void DrawCurve(System.Drawing.Pen pen, System.Drawing.PointF[] points) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 476public void DrawCurve(System.Drawing.Pen pen, System.Drawing.PointF[] points, int offset, int numberOfSegments) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 477public void DrawCurve(System.Drawing.Pen pen, System.Drawing.PointF[] points, int offset, int numberOfSegments, float tension) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 478public void DrawCurve(System.Drawing.Pen pen, System.Drawing.PointF[] points, float tension) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 490public void DrawImage(System.Drawing.Image image, System.Drawing.PointF point) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 491public void DrawImage(System.Drawing.Image image, System.Drawing.PointF[] destPoints) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 492public void DrawImage(System.Drawing.Image image, System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit srcUnit) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 493public void DrawImage(System.Drawing.Image image, System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Imaging.ImageAttributes? imageAttr) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 494public void DrawImage(System.Drawing.Image image, System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Imaging.ImageAttributes? imageAttr, System.Drawing.Graphics.DrawImageAbort? callback) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 495public void DrawImage(System.Drawing.Image image, System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Imaging.ImageAttributes? imageAttr, System.Drawing.Graphics.DrawImageAbort? callback, int callbackData) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 525public void DrawLine(System.Drawing.Pen pen, System.Drawing.PointF pt1, System.Drawing.PointF pt2) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 528public void DrawLines(System.Drawing.Pen pen, System.Drawing.PointF[] points) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 535public void DrawPolygon(System.Drawing.Pen pen, System.Drawing.PointF[] points) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 542public void DrawString(string? s, System.Drawing.Font font, System.Drawing.Brush brush, System.Drawing.PointF point) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 543public void DrawString(string? s, System.Drawing.Font font, System.Drawing.Brush brush, System.Drawing.PointF point, System.Drawing.StringFormat? format) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 555public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 556public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 557public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData, System.Drawing.Imaging.ImageAttributes? imageAttr) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 558public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF destPoint, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 559public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF destPoint, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 560public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF destPoint, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit unit, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData, System.Drawing.Imaging.ImageAttributes? imageAttr) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 561public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF[] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 562public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF[] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 563public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF[] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData, System.Drawing.Imaging.ImageAttributes? imageAttr) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 564public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 565public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 566public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit unit, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData, System.Drawing.Imaging.ImageAttributes? imageAttr) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 587public void FillClosedCurve(System.Drawing.Brush brush, System.Drawing.PointF[] points) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 588public void FillClosedCurve(System.Drawing.Brush brush, System.Drawing.PointF[] points, System.Drawing.Drawing2D.FillMode fillmode) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 589public void FillClosedCurve(System.Drawing.Brush brush, System.Drawing.PointF[] points, System.Drawing.Drawing2D.FillMode fillmode, float tension) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 601public void FillPolygon(System.Drawing.Brush brush, System.Drawing.PointF[] points) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 602public void FillPolygon(System.Drawing.Brush brush, System.Drawing.PointF[] points, System.Drawing.Drawing2D.FillMode fillMode) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 635public bool IsVisible(System.Drawing.PointF point) { 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); } 674public void TransformPoints(System.Drawing.Drawing2D.CoordinateSpace destSpace, System.Drawing.Drawing2D.CoordinateSpace srcSpace, System.Drawing.PointF[] pts) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1057public bool IsVisible(System.Drawing.PointF point) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1058public bool IsVisible(System.Drawing.PointF point, System.Drawing.Graphics? g) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1502public GraphicsPath(System.Drawing.PointF[] pts, byte[] types) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1503public GraphicsPath(System.Drawing.PointF[] pts, byte[] types, System.Drawing.Drawing2D.FillMode fillMode) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1508public System.Drawing.PointF[] PathPoints { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } } 1516public void AddBezier(System.Drawing.PointF pt1, System.Drawing.PointF pt2, System.Drawing.PointF pt3, System.Drawing.PointF pt4) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1519public void AddBeziers(System.Drawing.PointF[] points) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1521public void AddClosedCurve(System.Drawing.PointF[] points) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1522public void AddClosedCurve(System.Drawing.PointF[] points, float tension) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1525public void AddCurve(System.Drawing.PointF[] points) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1526public void AddCurve(System.Drawing.PointF[] points, int offset, int numberOfSegments, float tension) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1527public void AddCurve(System.Drawing.PointF[] points, float tension) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1536public void AddLine(System.Drawing.PointF pt1, System.Drawing.PointF pt2) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1539public void AddLines(System.Drawing.PointF[] points) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1545public void AddPolygon(System.Drawing.PointF[] points) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1552public void AddString(string s, System.Drawing.FontFamily family, int style, float emSize, System.Drawing.PointF origin, System.Drawing.StringFormat? format) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1567public System.Drawing.PointF GetLastPoint() { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1570public bool IsOutlineVisible(System.Drawing.PointF point, System.Drawing.Pen pen) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1571public bool IsOutlineVisible(System.Drawing.PointF pt, System.Drawing.Pen pen, System.Drawing.Graphics? graphics) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1578public bool IsVisible(System.Drawing.PointF point) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1579public bool IsVisible(System.Drawing.PointF pt, System.Drawing.Graphics? graphics) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1589public void Warp(System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1590public void Warp(System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.Drawing2D.Matrix? matrix) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1591public void Warp(System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.Drawing2D.Matrix? matrix, System.Drawing.Drawing2D.WarpMode warpMode) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1592public void Warp(System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.Drawing2D.Matrix? matrix, System.Drawing.Drawing2D.WarpMode warpMode, float flatness) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1603public int CopyData(ref System.Drawing.PointF[] points, ref byte[] types, int startIndex, int endIndex) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1605public int Enumerate(ref System.Drawing.PointF[] points, ref byte[] types) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1707public LinearGradientBrush(System.Drawing.PointF point1, System.Drawing.PointF point2, System.Drawing.Color color1, System.Drawing.Color color2) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1772public Matrix(System.Drawing.RectangleF rect, System.Drawing.PointF[] plgpts) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1790public void RotateAt(float angle, System.Drawing.PointF point) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1791public void RotateAt(float angle, System.Drawing.PointF point, System.Drawing.Drawing2D.MatrixOrder order) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1796public void TransformPoints(System.Drawing.PointF[] pts) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1798public void TransformVectors(System.Drawing.PointF[] pts) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1814public System.Drawing.PointF[]? Points { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } set { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } } 1821public PathGradientBrush(System.Drawing.PointF[] points) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1822public PathGradientBrush(System.Drawing.PointF[] points, System.Drawing.Drawing2D.WrapMode wrapMode) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1827public System.Drawing.PointF CenterPoint { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } set { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } } 1828public System.Drawing.PointF FocusScales { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } set { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } }
System.Drawing.Common.Tests (270)
mono\System.Drawing\GraphicsTests.cs (14)
706private static readonly PointF[] s_smallCurveF = [new(0, 0), new(15, 5), new(5, 15)]; 708private static readonly PointF[] s_largeCurveF = [new(0, 0), new(15, 5), new(5, 15), new(0, 20)]; 2437Assert.Throws<ArgumentNullException>(() => g.DrawImage(null, Array.Empty<PointF>())); 2445Assert.Throws<ArgumentNullException>(() => g.DrawImage(bmp, (PointF[])null)); 2453Assert.Throws<ArgumentException>(() => g.DrawImage(bmp, Array.Empty<PointF>())); 2461g.DrawImage(bmp, new PointF[] 2683PointF[] pts = [new(1, 1), new(2, 2), new(3, 3)]; 2689private static void DrawImage_ImagePointFRectangleGraphicsUnit(PointF[] pts) 2712PointF p = new(1, 1); 2719PointF p = new(1, 1); 2726PointF p = new(1, 1); 2733PointF p = new(1, 1); 2941PointF[] ptf = new PointF[5];
System\Drawing\Drawing2D\GraphicsPathIteratorTests.cs (26)
30private readonly PointF[] _twoPoints = [new(1, 2), new(20, 30)]; 226PointF[] points = []; 239PointF[] points = [new(1f, 1f), new(2f, 2f), new(3f, 3f), new(4f, 4f)]; 242PointF[] actualPoints = new PointF[4]; 254yield return new object[] { new PointF[1], new byte[2] }; 255yield return new object[] { new PointF[2], new byte[1] }; 260public void Enumerate_PointsTypesMismatch_ThrowsArgumentException(PointF[] points, byte[] types) 274PointF[] points = []; 283yield return new object[] { new PointF[1], null }; 289public void Enumerate_NullPointsTypes_ThrowsArgumentNullException(PointF[] points, byte[] types) 298public void CopyData_PointsTypesMismatch_ThrowsArgumentException(PointF[] points, byte[] types) 307public void CopyData_NullPointsTypes_ThrowsArgumentNullException(PointF[] points, byte[] types) 319PointF[] resultPoints = []; 329yield return new object[] { new PointF[3], new byte[3], int.MinValue, 2 }; 330yield return new object[] { new PointF[3], new byte[3], 0, int.MaxValue }; 331yield return new object[] { new PointF[3], new byte[3], 2, 0 }; 336public void CopyData_WithData_StartEndIndexesOutOfRange_ThrowsArgumentException(PointF[] points, byte[] types, int startIndex, int endIndex) 338PointF[] resultPoints = new PointF[points.Length]; 349PointF[] points = [new(1f, 1f), new(2f, 2f), new(3f, 3f), new(4f, 4f)]; 352PointF[] actualPoints = new PointF[1]; 365PointF[] points = [new(1f, 1f), new(2f, 2f), new(3f, 3f), new(4f, 4f)]; 368PointF[] actualPoints = new PointF[3];
System\Drawing\Drawing2D\GraphicsPathTests.cs (65)
61PointF[] fPoints = [ 96AssertExtensions.Throws<ArgumentException>(null, () => new GraphicsPath(new PointF[pointsLength], new byte[typesLength])); 198PointF[] points = [ 259gpf.AddLines(new PointF[] { new(1, 1), new(2, 2) }); 268gpi.AddLines(new PointF[] { new(1, 1) }); 272gpf.AddLines(new PointF[] { new(1, 1) }); 284PointF[] floatPoints = [ 317AssertExtensions.Throws<ArgumentNullException>("points", () => new GraphicsPath().AddLines((PointF[])null)); 324AssertExtensions.Throws<ArgumentException>("points", null, () => new GraphicsPath().AddLines(Array.Empty<PointF>())); 414PointF[] points = [ 427AssertExtensions.Throws<ArgumentNullException>("points", () => gp.AddBeziers((PointF[])null)); 433yield return new object[] { Array.Empty<PointF>() }; 434yield return new object[] { new PointF[1] { new(1f, 1f) } }; 435yield return new object[] { new PointF[2] { new(1f, 1f), new(2f, 2f) } }; 436yield return new object[] { new PointF[3] { new(1f, 1f), new(2f, 2f), new(3f, 3f) } }; 441public void AddBeziers_InvalidFloatPointsLength_ThrowsArgumentException(PointF[] points) 451PointF[] floatPoints = [new(1, 1), new(2, 2)]; 467PointF[] floatPoints = [new(1, 1), new(2, 2)]; 482PointF[] floatPoints = [new(1, 1), new(1, 1)]; 501PointF[] floatPoints = [new(1, 1), new(2, 2)]; 515PointF[] points = 524PointF[] expectedPoints = 558AssertExtensions.Throws<ArgumentException>(null, () => gp.AddCurve((PointF[])null)); 564yield return new object[] { Array.Empty<PointF>() }; 565yield return new object[] { new PointF[1] { new(1f, 1f) } }; 570public void AddCurve_InvalidFloatPointsLength_ThrowsArgumentException(PointF[] points) 604() => gp.AddCurve(new PointF[2] { new(1f, 1f), new(2f, 2f) }, 0, segment, 0.5f)); 615() => gp.AddCurve(new PointF[3] { new(1f, 1f), new(0f, 20f), new(20f, 0f) }, 1, 2, 0.5f)); 630gpf.AddClosedCurve(new PointF[3] { new(1, 1), new(2, 2), new(3, 3) }); 644gpf.AddClosedCurve(new PointF[3] { new(1, 1), new(1, 1), new(1, 1) }); 646gpf.AddClosedCurve(new PointF[3] { new(1, 1), new(1, 1), new(1, 1) }); 658gpf.AddClosedCurve(new PointF[3] { new(1, 1), new(2, 2), new(3, 3) }, 0.5f); 666AssertExtensions.Throws<ArgumentNullException>("points", () => gp.AddClosedCurve((PointF[])null)); 687yield return new object[] { Array.Empty<PointF>() }; 688yield return new object[] { new PointF[1] { new(1f, 1f) } }; 689yield return new object[] { new PointF[2] { new(1f, 1f), new(2f, 2f) } }; 694public void AddClosedCurve_InvalidFloatPointsLength_ThrowsArgumentException(PointF[] points) 722PointF endI = gpi.PathPoints[3]; 733PointF endF = gpf.PathPoints[3]; 893gpf.AddPolygon(new PointF[3] { new(1, 1), new(2, 2), new(3, 3) }); 918gpf.AddPolygon(new PointF[3] { new(1, 1), new(2, 2), new(3, 3) }); 922gpf.AddPolygon(new PointF[3] { new(1, 1), new(2, 2), new(3, 3) }); 926gpf.AddPolygon(new PointF[3] { new(1, 1), new(2, 2), new(3, 3) }); 930gpf.AddPolygon(new PointF[3] { new(1, 1), new(2, 2), new(3, 3) }); 940AssertExtensions.Throws<ArgumentNullException>("points", () => new GraphicsPath().AddPolygon((PointF[])null)); 945yield return new object[] { Array.Empty<PointF>() }; 946yield return new object[] { new PointF[1] { new(1f, 1f) } }; 947yield return new object[] { new PointF[2] { new(1f, 1f), new(2f, 2f) } }; 952public void AddPolygon_InvalidFloadPointsLength_ThrowsArgumentException(PointF[] points) 1650PointF[] expectedPoints = 1742AssertExtensions.Throws<ArgumentNullException>("pen", () => gp.IsOutlineVisible(default(PointF), null)); 2071PointF[] expectedPoints = 2086PointF[] expectedPoints = 2102PointF[] expectedPoints = 2119PointF[] expectedPoints = 2144PointF[] expectedPoints = 2170PointF[] expectedPoints = 2187PointF[] expectedPoints = 2227PointF[] expectedPoints = 2260PointF fPoint = new(13.0f, 2.0f); 2288PointF fPoint = new(29.0f, 29.0f); 2329private static void AssertReverse(GraphicsPath gp, PointF[] expectedPoints, byte[] expectedTypes) 2332PointF[] reversedPoints = gp.PathPoints; 2352new PointF[] 2383new PointF[]
System\Drawing\Drawing2D\LinearGradientBrushTests.cs (1)
24using LinearGradientBrush brush = new((PointF)point1, point2, color1, color2);
System\Drawing\Drawing2D\MatrixTests.cs (38)
119using Matrix matrix = new(rect, plgpnts.Select(p => (PointF)p).ToArray()); 140AssertExtensions.Throws<ArgumentException>(null, () => new Matrix(default, new PointF[length])); 148Assert.Throws<OutOfMemoryException>(() => new Matrix(new RectangleF(1, 1, 0, 1), new PointF[3])); 155Assert.Throws<OutOfMemoryException>(() => new Matrix(new RectangleF(1, 1, 1, 0), new PointF[3])); 398yield return new object[] { new Matrix(10, 20, 30, 40, 50, 60), 180, PointF.Empty, MatrixOrder.Prepend, new float[] { -9.999996f, -19.9999943f, -30.0000019f, -40.0000038f, 50, 60 }, null, false }; 399yield return new object[] { new Matrix(10, 20, 30, 40, 50, 60), 180, PointF.Empty, MatrixOrder.Append, new float[] { -9.999996f, -20, -30f, -40f, -50, -60 }, null, false }; 401yield return new object[] { new Matrix(10, 20, 30, 40, 50, 60), 540, PointF.Empty, MatrixOrder.Prepend, new float[] { -9.999996f, -19.9999943f, -30.0000019f, -40.0000038f, 50, 60 }, null, false }; 402yield return new object[] { new Matrix(10, 20, 30, 40, 50, 60), 540, PointF.Empty, MatrixOrder.Append, new float[] { -9.999996f, -20, -30f, -40f, -50, -60 }, null, false }; 404yield return new object[] { new Matrix(), 45, PointF.Empty, MatrixOrder.Prepend, new float[] { 0.707106769f, 0.707106769f, -0.707106829f, 0.707106769f, 0, 0 }, null, false }; 405yield return new object[] { new Matrix(), 45, PointF.Empty, MatrixOrder.Append, new float[] { 0.707106769f, 0.707106769f, -0.707106829f, 0.707106769f, 0, 0 }, null, false }; 410yield return new object[] { rotated45.Clone(), 135, PointF.Empty, MatrixOrder.Prepend, new float[] { -1, 0, 0, -1, 0, 0 }, null, false }; 411yield return new object[] { rotated45.Clone(), 135, PointF.Empty, MatrixOrder.Append, new float[] { -1, 0, 0, -1, 0, 0 }, null, false }; 414yield return new object[] { new Matrix(), 90, PointF.Empty, MatrixOrder.Prepend, new float[] { 0, 1, -1, 0, 0, 0 }, null, false }; 415yield return new object[] { new Matrix(), 90, PointF.Empty, MatrixOrder.Append, new float[] { 0, 1, -1, 0, 0, 0 }, null, false }; 420yield return new object[] { rotated90.Clone(), 270, PointF.Empty, MatrixOrder.Prepend, new float[] { 1, 0, 0, 1, 0, 0 }, null, true }; 421yield return new object[] { rotated90.Clone(), 270, PointF.Empty, MatrixOrder.Append, new float[] { 1, 0, 0, 1, 0, 0 }, null, true }; 427yield return new object[] { new Matrix(10, 20, 30, 40, 50, 60), float.NaN, PointF.Empty, MatrixOrder.Prepend, new float[] { float.NaN, float.NaN, float.NaN, float.NaN, 50, 60 }, new float[] { float.NaN, float.NaN, float.NaN, float.NaN, float.NaN, float.NaN }, false }; 428yield return new object[] { new Matrix(10, 20, 30, 40, 50, 60), float.NaN, PointF.Empty, MatrixOrder.Append, new float[] { float.NaN, float.NaN, float.NaN, float.NaN, float.NaN, float.NaN }, null, false }; 430yield return new object[] { new Matrix(10, 20, 30, 40, 50, 60), float.PositiveInfinity, PointF.Empty, MatrixOrder.Prepend, new float[] { float.NaN, float.NaN, float.NaN, float.NaN, 50, 60 }, new float[] { float.NaN, float.NaN, float.NaN, float.NaN, float.NaN, float.NaN }, false }; 431yield return new object[] { new Matrix(10, 20, 30, 40, 50, 60), float.PositiveInfinity, PointF.Empty, MatrixOrder.Append, new float[] { float.NaN, float.NaN, float.NaN, float.NaN, float.NaN, float.NaN }, null, false }; 433yield return new object[] { new Matrix(10, 20, 30, 40, 50, 60), float.NegativeInfinity, PointF.Empty, MatrixOrder.Prepend, new float[] { float.NaN, float.NaN, float.NaN, float.NaN, 50, 60 }, new float[] { float.NaN, float.NaN, float.NaN, float.NaN, float.NaN, float.NaN }, false }; 434yield return new object[] { new Matrix(10, 20, 30, 40, 50, 60), float.NegativeInfinity, PointF.Empty, MatrixOrder.Append, new float[] { float.NaN, float.NaN, float.NaN, float.NaN, float.NaN, float.NaN }, null, false }; 439public void Rotate_Matrix_Success(Matrix matrix, float angle, PointF point, MatrixOrder order, float[] expectedElements, float[] expectedElementsRotateAt, bool isIdentity) 494AssertExtensions.Throws<ArgumentException>(null, () => disposedMatrix.RotateAt(1, PointF.Empty)); 495AssertExtensions.Throws<ArgumentException>(null, () => disposedMatrix.RotateAt(1, PointF.Empty, MatrixOrder.Append)); 504AssertExtensions.Throws<ArgumentException>(null, () => matrix.RotateAt(1, PointF.Empty, order)); 720PointF[] pointFs = points.Select(p => (PointF)p).ToArray(); 722Assert.Equal(expectedPoints.Select(p => (PointF)p), pointFs); 731AssertExtensions.Throws<ArgumentNullException>("pts", () => matrix.TransformPoints((PointF[])null)); 739AssertExtensions.Throws<ArgumentException>(null, () => matrix.TransformPoints(Array.Empty<PointF>())); 748AssertExtensions.Throws<ArgumentException>(null, () => disposedMatrix.TransformPoints(new PointF[1])); 775PointF[] pointFs = points.Select(p => (PointF)p).ToArray(); 777Assert.Equal(expectedPoints.Select(p => (PointF)p), pointFs); 798AssertExtensions.Throws<ArgumentNullException>("pts", () => matrix.TransformVectors((PointF[])null)); 807AssertExtensions.Throws<ArgumentException>(null, () => matrix.TransformVectors(Array.Empty<PointF>())); 817AssertExtensions.Throws<ArgumentException>(null, () => disposedMatrix.TransformVectors(new PointF[1]));
System\Drawing\Drawing2D\PathGradientBrushTests.cs (8)
31private readonly PointF[] _defaultFloatPoints = [new(1, 2), new(20, 30)]; 70AssertExtensions.Throws<ArgumentNullException>("points", () => new PathGradientBrush((PointF[])null)); 80Assert.Throws<ArgumentException>(() => new PathGradientBrush(new PointF[pointsLength])); 81Assert.Throws<ArgumentException>(() => new PathGradientBrush(new PointF[pointsLength], WrapMode.Clamp)); 114path.AddLines(new PointF[] { new(1, 1) }); 219PointF centralPoint = new(float.MaxValue, float.MinValue); 220PointF defaultCentralPoint = new(10.5f, 16f); 899PointF point = new(2.5f, 3.4f);
System\Drawing\Graphics_DrawBezierTests.cs (19)
47PointF[] points = 67AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawBezier(null, PointF.Empty, PointF.Empty, PointF.Empty, PointF.Empty)); 80AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawBezier(pen, PointF.Empty, PointF.Empty, PointF.Empty, PointF.Empty)); 94Assert.Throws<InvalidOperationException>(() => graphics.DrawBezier(pen, PointF.Empty, PointF.Empty, PointF.Empty, PointF.Empty)); 122AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawBeziers(null, new PointF[2])); 134AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawBeziers(pen, new PointF[2])); 144AssertExtensions.Throws<ArgumentNullException>("points", () => graphics.DrawBeziers(pen, (PointF[])null)); 154AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawBeziers(pen, Array.Empty<PointF>())); 167Assert.Throws<InvalidOperationException>(() => graphics.DrawBeziers(pen, new PointF[2])); 184AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawBeziers(pen, new PointF[2]));
System\Drawing\Graphics_DrawLineTests.cs (15)
30graphics.DrawLines(pen, new PointF[] { new(1.0f, 1.0f), new(1.0f, 10.0f), new(20.0f, 5.0f), new(25.0f, 30.0f) }); 45AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawLine(null, PointF.Empty, PointF.Empty)); 59AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawLine(pen, PointF.Empty, PointF.Empty)); 74Assert.Throws<InvalidOperationException>(() => graphics.DrawLine(pen, PointF.Empty, PointF.Empty)); 93AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawLine(pen, PointF.Empty, PointF.Empty)); 103AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawLines(null, new PointF[2])); 115AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawLines(pen, new PointF[2])); 125AssertExtensions.Throws<ArgumentNullException>("points", () => graphics.DrawLines(pen, (PointF[])null)); 137AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawLines(pen, new PointF[length])); 150Assert.Throws<InvalidOperationException>(() => graphics.DrawLines(pen, new PointF[2])); 167AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawLines(pen, new PointF[2]));
System\Drawing\Graphics_GetContextTests.Core.cs (7)
16graphics.GetContextInfo(out PointF offset); 32graphics.GetContextInfo(out PointF offset); 49graphics.GetContextInfo(out PointF offset); 66graphics.GetContextInfo(out PointF offset); 85graphics.GetContextInfo(out PointF offset); 106graphics.GetContextInfo(out PointF offset); 125graphics.GetContextInfo(out PointF offset, out Region? clip);
System\Drawing\GraphicsTests.cs (65)
1755new PointF[] { new Point(1, 1), new Point(2, 2) }, 1756new PointF[] { new Point(1, 1), new Point(2, 2) } 1763new PointF[] { new Point(1, 1), new Point(2, 2) }, 1764new PointF[] { new Point(9, 12), new Point(13, 18) } 1771new PointF[] { new Point(1, 1), new Point(2, 2) }, 1772new PointF[] { new Point(1, 1), new Point(2, 2) } 1779new PointF[] { new Point(1, 1), new Point(2, 2) }, 1780new PointF[] { new Point(9, 12), new Point(13, 18) } 1787new PointF[] { new Point(1, 1), new Point(2, 2) }, 1788new PointF[] { new(0.5f, -1.5f), new Point(0, -1) } 1795new PointF[] { new Point(1, 1), new Point(2, 2) }, 1796new PointF[] { new(0.5f, -1.5f), new Point(0, -1) } 1802public void TransformPoints_PointFs_Success(CoordinateSpace destSpace, CoordinateSpace srcSpace, PointF[] points, PointF[] expected) 1841var points = new PointF[] { new(1, 1) }; 1854AssertExtensions.Throws<ArgumentException>(null, () => graphics.TransformPoints(destSpace, CoordinateSpace.World, new PointF[] { new(1, 1) })); 1865AssertExtensions.Throws<ArgumentException>(null, () => graphics.TransformPoints(CoordinateSpace.World, srcSpace, new PointF[] { new(1, 1) })); 1874AssertExtensions.Throws<ArgumentNullException>("pts", () => graphics.TransformPoints(CoordinateSpace.Page, CoordinateSpace.Page, (PointF[])null)); 1883AssertExtensions.Throws<ArgumentException>(null, () => graphics.TransformPoints(CoordinateSpace.Page, CoordinateSpace.Page, Array.Empty<PointF>())); 1895Assert.Throws<InvalidOperationException>(() => graphics.TransformPoints(CoordinateSpace.Page, CoordinateSpace.Page, [PointF.Empty])); 1911AssertExtensions.Throws<ArgumentException>(null, () => graphics.TransformPoints(CoordinateSpace.Page, CoordinateSpace.Page, [PointF.Empty])); 2312AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawPolygon(null, new PointF[2])); 2324AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawPolygon(pen, new PointF[2])); 2334AssertExtensions.Throws<ArgumentNullException>("points", () => graphics.DrawPolygon(pen, (PointF[])null)); 2346AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawPolygon(pen, new PointF[length])); 2359Assert.Throws<InvalidOperationException>(() => graphics.DrawPolygon(pen, new PointF[2])); 2376AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawPolygon(pen, new PointF[2])); 2457AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawCurve(null, new PointF[2])); 2459AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawCurve(null, new PointF[2], 1)); 2460AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawCurve(null, new PointF[2], 0, 2)); 2462AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawCurve(null, new PointF[2], 0, 2, 1)); 2474AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new PointF[2])); 2476AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new PointF[2], 1)); 2477AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new PointF[2], 0, 2)); 2479AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new PointF[2], 0, 2, 1)); 2489AssertExtensions.Throws<ArgumentNullException>("points", () => graphics.DrawCurve(pen, (PointF[])null)); 2491AssertExtensions.Throws<ArgumentNullException>("points", () => graphics.DrawCurve(pen, (PointF[])null, 1)); 2494AssertExtensions.Throws<ArgumentNullException>("points", () => graphics.DrawCurve(pen, (PointF[])null, 0, 2, 1)); 2506AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new PointF[length])); 2508AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new PointF[length], 1)); 2509AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new PointF[length], 0, length)); 2511AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new PointF[length], 0, length, 1)); 2525AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new PointF[length], offset, numberOfSegments)); 2527AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new PointF[length], offset, numberOfSegments, 1)); 2540Assert.Throws<InvalidOperationException>(() => graphics.DrawCurve(pen, new PointF[2])); 2542Assert.Throws<InvalidOperationException>(() => graphics.DrawCurve(pen, new PointF[2], 1)); 2543Assert.Throws<InvalidOperationException>(() => graphics.DrawCurve(pen, new PointF[2], 0, 2)); 2545Assert.Throws<InvalidOperationException>(() => graphics.DrawCurve(pen, new PointF[2], 0, 2, 1)); 2562AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new PointF[2])); 2564AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new PointF[2], 1)); 2565AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new PointF[2], 0, 2)); 2567AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new PointF[2], 0, 2, 1)); 2577AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawClosedCurve(null, new PointF[3])); 2578AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawClosedCurve(null, new PointF[3], 1, FillMode.Winding)); 2591AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawClosedCurve(pen, new PointF[3])); 2592AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawClosedCurve(pen, new PointF[3], 1, FillMode.Winding)); 2603AssertExtensions.Throws<ArgumentNullException>("points", () => graphics.DrawClosedCurve(pen, (PointF[])null)); 2604AssertExtensions.Throws<ArgumentNullException>("points", () => graphics.DrawClosedCurve(pen, (PointF[])null, 1, FillMode.Winding)); 2618AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawClosedCurve(pen, new PointF[length])); 2619AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawClosedCurve(pen, new PointF[length], 1, FillMode.Winding)); 2633Assert.Throws<InvalidOperationException>(() => graphics.DrawClosedCurve(pen, new PointF[3])); 2634Assert.Throws<InvalidOperationException>(() => graphics.DrawClosedCurve(pen, new PointF[3], 1, FillMode.Winding)); 2652AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawClosedCurve(pen, new PointF[3])); 2653AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawClosedCurve(pen, new PointF[3], 1, FillMode.Alternate)); 2829PointF pointF = new(10.5f, 10.5f);
System\Drawing\IconConverterTests.cs (4)
43Assert.False(_icoConv.CanConvertFrom(null, typeof(PointF)), "PointF"); 56Assert.False(_icoConvFrmTD.CanConvertFrom(null, typeof(PointF)), "TD PointF"); 79Assert.False(_icoConv.CanConvertTo(null, typeof(PointF)), "PointF"); 97Assert.False(_icoConvFrmTD.CanConvertTo(null, typeof(PointF)), "TD PointF");
System\Drawing\ImageConverterTests.cs (4)
69Assert.False(_imgConv.CanConvertFrom(null, typeof(PointF)), "PointF"); 82Assert.False(_imgConvFrmTD.CanConvertFrom(null, typeof(PointF)), "TD PointF"); 101Assert.False(_imgConv.CanConvertTo(null, typeof(PointF)), "PointF"); 115Assert.False(_imgConvFrmTD.CanConvertTo(null, typeof(PointF)), "TD PointF");
System\Drawing\RegionTests.cs (4)
1388Assert.Equal(expected, region.IsVisible((PointF)point)); 1392Assert.Equal(expected, region.IsVisible((PointF)point, s_graphic)); 1393Assert.Equal(expected, region.IsVisible((PointF)point, disposedGraphics)); 1394Assert.Equal(expected, region.IsVisible((PointF)point, null));
System.Drawing.Primitives (67)
System\Drawing\Point.cs (5)
77/// Creates a <see cref='System.Drawing.PointF'/> with the coordinates of the specified <see cref='System.Drawing.Point'/> 79public static implicit operator PointF(Point p) => new PointF(p.X, p.Y); 123public static Point Ceiling(PointF value) => new Point(unchecked((int)Math.Ceiling(value.X)), unchecked((int)Math.Ceiling(value.Y))); 128public static Point Truncate(PointF value) => new Point(unchecked((int)value.X), unchecked((int)value.Y)); 133public static Point Round(PointF value) => new Point(unchecked((int)Math.Round(value.X)), unchecked((int)Math.Round(value.Y)));
System\Drawing\PointF.cs (52)
16public struct PointF : IEquatable<PointF> 19/// Creates a new instance of the <see cref='System.Drawing.PointF'/> class with member data left uninitialized. 21public static readonly PointF Empty; 26/// Initializes a new instance of the <see cref='System.Drawing.PointF'/> class with the specified coordinates. 35/// Initializes a new instance of the <see cref='System.Drawing.PointF'/> struct from the specified 45/// Creates a new <see cref="System.Numerics.Vector2"/> from this <see cref="System.Drawing.PointF"/>. 50/// Gets a value indicating whether this <see cref='System.Drawing.PointF'/> is empty. 56/// Gets the x-coordinate of this <see cref='System.Drawing.PointF'/>. 65/// Gets the y-coordinate of this <see cref='System.Drawing.PointF'/>. 74/// Converts the specified <see cref="System.Drawing.PointF"/> to a <see cref="System.Numerics.Vector2"/>. 76public static explicit operator Vector2(PointF point) => point.ToVector2(); 79/// Converts the specified <see cref="System.Numerics.Vector2"/> to a <see cref="System.Drawing.PointF"/>. 81public static explicit operator PointF(Vector2 vector) => new PointF(vector); 84/// Translates a <see cref='System.Drawing.PointF'/> by a given <see cref='System.Drawing.Size'/> . 86public static PointF operator +(PointF pt, Size sz) => Add(pt, sz); 89/// Translates a <see cref='System.Drawing.PointF'/> by the negative of a given <see cref='System.Drawing.Size'/> . 91public static PointF operator -(PointF pt, Size sz) => Subtract(pt, sz); 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); 104/// Compares two <see cref='System.Drawing.PointF'/> objects. The result specifies whether the values of the 105/// <see cref='System.Drawing.PointF.X'/> and <see cref='System.Drawing.PointF.Y'/> properties of the two 106/// <see cref='System.Drawing.PointF'/> objects are equal. 108public static bool operator ==(PointF left, PointF right) => left.X == right.X && left.Y == right.Y; 111/// Compares two <see cref='System.Drawing.PointF'/> objects. The result specifies whether the values of the 112/// <see cref='System.Drawing.PointF.X'/> or <see cref='System.Drawing.PointF.Y'/> properties of the two 113/// <see cref='System.Drawing.PointF'/> objects are unequal. 115public static bool operator !=(PointF left, PointF right) => !(left == right); 118/// Translates a <see cref='System.Drawing.PointF'/> by a given <see cref='System.Drawing.Size'/> . 120public static PointF Add(PointF pt, Size sz) => new PointF(pt.X + sz.Width, pt.Y + sz.Height); 123/// Translates a <see cref='System.Drawing.PointF'/> by the negative of a given <see cref='System.Drawing.Size'/> . 125public static PointF Subtract(PointF pt, Size sz) => new PointF(pt.X - sz.Width, pt.Y - sz.Height); 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); 137public override readonly bool Equals([NotNullWhen(true)] object? obj) => obj is PointF && Equals((PointF)obj); 139public readonly bool Equals(PointF other) => this == other;
System\Drawing\RectangleF.cs (4)
43public RectangleF(PointF location, SizeF size) 89public PointF Location 214public readonly bool Contains(PointF pt) => Contains(pt.X, pt.Y); 308public void Offset(PointF pos) => Offset(pos.X, pos.Y);
System\Drawing\SizeF.cs (6)
37/// <see cref='System.Drawing.PointF'/>. 39public SizeF(PointF pt) 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); 173public readonly PointF ToPointF() => (PointF)this;
System.Private.Windows.Core (8)
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (4)
193/// Writes a <see cref="PointF"/> in binary format. 195public static void WritePointF(Stream stream, PointF value) 200new ClassInfo(1, typeof(PointF).FullName!, s_pointMemberNames), 702case PointF point:
System\Private\Windows\Nrbf\CoreNrbfSerializer.cs (2)
88{ Types.ToTypeName($"{Types.PointFType}"), typeof(PointF) }, 155|| type == typeof(PointF)
System\Private\Windows\Nrbf\SerializationRecordExtensions.cs (2)
162/// Tries to get this object as a <see cref="PointF"/>. 173|| !classInfo.TypeNameMatches(typeof(PointF))
System.Private.Windows.Core.Tests (1)
System\Private\Windows\Ole\BinaryFormatUtilitiesTests.cs (1)
1009public PointF PointF = new(1, 2);
System.Private.Windows.Core.TestUtilities (12)
FluentAssertions\FluentAssertExtensions.cs (10)
22/// current <see cref="PointF"/>. 24public static PointFAssertions Should(this PointF actualValue) => new(actualValue); 68/// Asserts a <see cref="PointF"/> value approximates another value as close as possible. 74PointF expectedValue, 86/// Asserts that two <see cref="PointF"/> collections contain the same items in the same order 90public static AndConstraint<GenericCollectionAssertions<PointF>> BeApproximatelyEquivalentTo( 91this GenericCollectionAssertions<PointF> parent, 92IEnumerable<PointF> expectation, 98(PointF actual, PointF expected) =>
FluentAssertions\PointFAssertions.cs (2)
8public class PointFAssertions(PointF value) 10public PointF Subject { get; } = value;
System.Windows.Forms (8)
GlobalUsings.cs (1)
36global using PointF = System.Drawing.PointF;
System\Windows\Forms\ActiveX\AxHost.cs (2)
1077PointF pcont = default; 1090PointF pcont = new(sz.Width, sz.Height);
System\Windows\Forms\ActiveX\AxHost.OleInterfaces.cs (1)
160HRESULT IOleControlSite.Interface.TransformCoords(POINTL* pPtlHimetric, PointF* pPtfContainer, uint dwFlags)
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (2)
1113PointF pcont = default; 1125PointF pcont = new(sz.Width, sz.Height);
System\Windows\Forms\Controls\WebBrowser\WebBrowserSiteBase.cs (1)
82HRESULT IOleControlSite.Interface.TransformCoords(POINTL* pPtlHimetric, PointF* pPtfContainer, uint dwFlags)
System\Windows\Forms\Rendering\DrawingEventArgs.cs (1)
156graphics.GetContextInfo(out PointF offset, out Region? clip);
System.Windows.Forms.Primitives.Tests (1)
System\SpanReaderTests.cs (1)
139reader.TryRead<PointF>(readCount, out _).Should().BeFalse();
System.Windows.Forms.Tests (2)
System\Windows\Forms\BinaryFormat\WinFormsBinaryFormattedObjectTests.cs (2)
232default(PointF), 233new PointF[] { default },