468 references to GraphicsUnit
PresentationUI (1)
MS\Internal\Documents\RMEnrollmentPage1.Designer.cs (1)
150_instructionlabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
System.Drawing (1)
System.Drawing.cs (1)
61[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.GraphicsUnit))]
System.Drawing.Common (117)
misc\DpiHelper.cs (1)
124graphics.DrawImage(logicalImage, destRect, sourceRect, GraphicsUnit.Pixel);
System\Drawing\Bitmap.cs (1)
253GraphicsUnit.Pixel,
System\Drawing\Font.cs (21)
26private GraphicsUnit _fontUnit; 88public GraphicsUnit Unit => _fontUnit; 148GraphicsUnit unit = (GraphicsUnit)info.GetValue("Unit", typeof(GraphicsUnit))!; // Do not rename (binary serialization) 374public Font(FontFamily family, float emSize, FontStyle style, GraphicsUnit unit) 382public Font(FontFamily family, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet) 390public Font(FontFamily family, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont) 398public Font(string familyName, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet) 406public Font(string familyName, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont) 421Initialize(family, emSize, style, GraphicsUnit.Point, (byte)FONT_CHARSET.DEFAULT_CHARSET, false); 427public Font(FontFamily family, float emSize, GraphicsUnit unit) 437Initialize(family, emSize, FontStyle.Regular, GraphicsUnit.Point, (byte)FONT_CHARSET.DEFAULT_CHARSET, false); 443public Font(string familyName, float emSize, FontStyle style, GraphicsUnit unit) 453Initialize(familyName, emSize, style, GraphicsUnit.Point, (byte)FONT_CHARSET.DEFAULT_CHARSET, IsVerticalName(familyName)); 459public Font(string familyName, float emSize, GraphicsUnit unit) 469Initialize(familyName, emSize, FontStyle.Regular, GraphicsUnit.Point, (byte)FONT_CHARSET.DEFAULT_CHARSET, IsVerticalName(familyName)); 481GraphicsUnit unit; 495private void Initialize(string familyName, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont) 511private void Initialize(FontFamily family, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont) 738if (Unit == GraphicsUnit.Point)
System\Drawing\FontConverter.cs (24)
46case GraphicsUnit.Display: 50case GraphicsUnit.Document: 54case GraphicsUnit.Point: 58case GraphicsUnit.Inch: 62case GraphicsUnit.Millimeter: 66case GraphicsUnit.Pixel: 70case GraphicsUnit.World: 98else if (font.Unit != GraphicsUnit.Point) 124types[3] = typeof(GraphicsUnit); 173GraphicsUnit units = GraphicsUnit.Point; 299private static GraphicsUnit ParseGraphicsUnits(string units) => 302"display" => GraphicsUnit.Display, 303"doc" => GraphicsUnit.Document, 304"pt" => GraphicsUnit.Point, 305"in" => GraphicsUnit.Inch, 306"mm" => GraphicsUnit.Millimeter, 307"px" => GraphicsUnit.Pixel, 308"world" => GraphicsUnit.World, 323GraphicsUnit unit = GraphicsUnit.Point; 332unit = (GraphicsUnit)value; 473public FontUnitConverter() : base(typeof(GraphicsUnit)) { } 483filteredValues.Remove(GraphicsUnit.Display);
System\Drawing\Graphics.cs (50)
328public GraphicsUnit PageUnit 334return (GraphicsUnit)unit; 338if (value is < GraphicsUnit.World or > GraphicsUnit.Millimeter) 339throw new InvalidEnumArgumentException(nameof(value), (int)value, typeof(GraphicsUnit)); 2041DrawImage(image, rect, 0, 0, width, height, GraphicsUnit.Pixel); 2089public void DrawImage(Image image, float x, float y, RectangleF srcRect, GraphicsUnit srcUnit) 2104public void DrawImage(Image image, int x, int y, Rectangle srcRect, GraphicsUnit srcUnit) 2107public void DrawImage(Image image, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit) 2125public void DrawImage(Image image, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit) 2128public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit) 2154public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes? imageAttr) => 2161GraphicsUnit srcUnit, 2170GraphicsUnit srcUnit, 2201public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit) => 2208GraphicsUnit srcUnit, 2215GraphicsUnit srcUnit, 2223GraphicsUnit srcUnit, 2262GraphicsUnit srcUnit) => DrawImage(image, destRect, srcX, srcY, srcWidth, srcHeight, srcUnit, null); 2271GraphicsUnit srcUnit, 2281GraphicsUnit srcUnit, 2292GraphicsUnit srcUnit, 2322GraphicsUnit srcUnit) => DrawImage(image, destRect, (float)srcX, srcY, srcWidth, srcHeight, srcUnit, null); 2331GraphicsUnit srcUnit, 2341GraphicsUnit srcUnit, 2352GraphicsUnit srcUnit, 2492GraphicsUnit srcUnit, 2499GraphicsUnit srcUnit, 2507GraphicsUnit srcUnit, 2514GraphicsUnit srcUnit, 2522GraphicsUnit srcUnit, 2529GraphicsUnit srcUnit, 2537GraphicsUnit srcUnit, 2544GraphicsUnit srcUnit, 2552GraphicsUnit srcUnit, 2559GraphicsUnit srcUnit, 2567GraphicsUnit srcUnit, 2574GraphicsUnit srcUnit, 3058GraphicsUnit unit, 3083GraphicsUnit unit, 3099GraphicsUnit unit, 3124GraphicsUnit unit, 3133GraphicsUnit unit, 3166GraphicsUnit unit, 3464public GraphicsContainer BeginContainer(RectangleF dstrect, RectangleF srcrect, GraphicsUnit unit) 3510public GraphicsContainer BeginContainer(Rectangle dstrect, Rectangle srcrect, GraphicsUnit unit) 3613/// <inheritdoc cref="DrawImage(Image, Effect, RectangleF, Matrix?, GraphicsUnit, ImageAttributes?)"/> 3616Effect effect) => DrawImage(image, effect, srcRect: default, transform: default, GraphicsUnit.Pixel, imageAttr: null); 3632GraphicsUnit srcUnit = GraphicsUnit.Pixel,
System\Drawing\Image.cs (2)
582public RectangleF GetBounds(ref GraphicsUnit pageUnit) 586pageUnit = GraphicsUnit.Pixel;
System\Drawing\Imaging\MetafileFrameUnit.cs (5)
15Pixel = GraphicsUnit.Pixel, 19Point = GraphicsUnit.Point, 23Inch = GraphicsUnit.Inch, 27Document = GraphicsUnit.Document, 31Millimeter = GraphicsUnit.Millimeter,
System\Drawing\Pen.cs (2)
48PInvokeGdiPlus.GdipCreatePen1((uint)color.ToArgb(), width, (int)GraphicsUnit.World, &pen).ThrowIfFailed(); 71PInvokeGdiPlus.GdipCreatePen2(brush.NativeBrush, width, (int)GraphicsUnit.World, &pen).ThrowIfFailed();
System\Drawing\StringUnit.cs (7)
14World = GraphicsUnit.World, 18Display = GraphicsUnit.Display, 22Pixel = GraphicsUnit.Pixel, 26Point = GraphicsUnit.Point, 30Inch = GraphicsUnit.Inch, 34Document = GraphicsUnit.Document, 38Millimeter = GraphicsUnit.Millimeter,
System\Drawing\SystemFonts.cs (4)
210if (defaultFont.Unit != GraphicsUnit.Point) 250else if (dialogFont.Unit != GraphicsUnit.Point) 264return new Font(font.FontFamily, font.SizeInPoints, font.Style, GraphicsUnit.Point, font.GdiCharSet, font.GdiVerticalFont); 281: font.Unit != GraphicsUnit.Point ? FontInPoints(font) : font;
System.Drawing.Common.Tests (268)
mono\System.Drawing.Imaging\BmpCodecTests.cs (10)
45GraphicsUnit unit = GraphicsUnit.World; 111GraphicsUnit unit = GraphicsUnit.World; 177GraphicsUnit unit = GraphicsUnit.World; 364GraphicsUnit unit = GraphicsUnit.World; 495GraphicsUnit unit = GraphicsUnit.World;
mono\System.Drawing.Imaging\GifCodecTests.cs (2)
42GraphicsUnit unit = GraphicsUnit.World;
mono\System.Drawing.Imaging\IconCodecTests.cs (12)
69GraphicsUnit unit = GraphicsUnit.World; 218GraphicsUnit unit = GraphicsUnit.World; 423GraphicsUnit unit = GraphicsUnit.World; 645GraphicsUnit unit = GraphicsUnit.World; 903GraphicsUnit unit = GraphicsUnit.World; 1836GraphicsUnit unit = GraphicsUnit.World;
mono\System.Drawing.Imaging\JpegCodecTests.cs (4)
44GraphicsUnit unit = GraphicsUnit.World; 171GraphicsUnit unit = GraphicsUnit.World;
mono\System.Drawing.Imaging\PngCodecTests.cs (6)
44GraphicsUnit unit = GraphicsUnit.World; 246GraphicsUnit unit = GraphicsUnit.World; 354GraphicsUnit unit = GraphicsUnit.World;
mono\System.Drawing.Imaging\TiffCodecTests.cs (2)
44GraphicsUnit unit = GraphicsUnit.World;
mono\System.Drawing\GraphicsTests.cs (35)
111Assert.Equal(GraphicsUnit.Display, g.PageUnit); 127g.PageUnit = GraphicsUnit.Inch; 138Assert.Equal(GraphicsUnit.Inch, g.PageUnit); 290g.PageUnit = GraphicsUnit.Inch; 303g.PageUnit = GraphicsUnit.Display; 316Assert.Equal(GraphicsUnit.Inch, g.PageUnit); 330Assert.Equal(GraphicsUnit.Display, g.PageUnit); 912AssertEquals(message + ".PageUnit", GraphicsUnit.Display, g.PageUnit); 927AssertEquals(message + ".PageUnit", GraphicsUnit.Inch, g.PageUnit); 960g.PageUnit = GraphicsUnit.Inch; 993g.PageUnit = GraphicsUnit.Inch; 1003GraphicsContainer gc = g.BeginContainer(new Rectangle(10, 20, 30, 40), new Rectangle(10, 20, 300, 400), GraphicsUnit.Millimeter); 1027g.PageUnit = GraphicsUnit.Inch; 1037GraphicsContainer gc = g.BeginContainer(new RectangleF(40, 30, 20, 10), new RectangleF(10, 20, 30, 40), GraphicsUnit.Inch); 1047private static void BeginContainer_GraphicsUnit(GraphicsUnit unit) 1057Assert.Throws<ArgumentException>(() => BeginContainer_GraphicsUnit(GraphicsUnit.Display)); 1063BeginContainer_GraphicsUnit(GraphicsUnit.Document); 1064BeginContainer_GraphicsUnit(GraphicsUnit.Inch); 1065BeginContainer_GraphicsUnit(GraphicsUnit.Millimeter); 1066BeginContainer_GraphicsUnit(GraphicsUnit.Pixel); 1067BeginContainer_GraphicsUnit(GraphicsUnit.Point); 1073Assert.Throws<ArgumentException>(() => BeginContainer_GraphicsUnit(GraphicsUnit.World)); 1079Assert.Throws<ArgumentException>(() => BeginContainer_GraphicsUnit((GraphicsUnit)int.MinValue)); 1108g.PageUnit = GraphicsUnit.Inch; 2591Assert.Throws<ArgumentNullException>(() => g.DrawImage(null, default(Rectangle), default, GraphicsUnit.Display)); 2594private static void DrawImage_ImageRectangleRectangleGraphicsUnit(GraphicsUnit unit) 2605Assert.Throws<ArgumentException>(() => DrawImage_ImageRectangleRectangleGraphicsUnit(GraphicsUnit.Display)); 2612DrawImage_ImageRectangleRectangleGraphicsUnit(GraphicsUnit.Pixel); 2618Assert.Throws<ArgumentException>(() => DrawImage_ImageRectangleRectangleGraphicsUnit(GraphicsUnit.World)); 2628Assert.Throws<ArgumentNullException>(() => g.DrawImage(null, pts, r, GraphicsUnit.Pixel)); 2636g.DrawImage(bmp, pts, r, GraphicsUnit.Pixel); 2686Assert.Throws<ArgumentNullException>(() => g.DrawImage(null, pts, r, GraphicsUnit.Pixel)); 2694g.DrawImage(bmp, pts, r, GraphicsUnit.Pixel); 2745g.DrawImage(bmp, pts, r, GraphicsUnit.Pixel, null); 2757g.DrawImage(bmp, pts, r, GraphicsUnit.Pixel, ia);
System\Drawing\Drawing2D\GraphicsPathTests.cs (1)
1782graphics.PageUnit = GraphicsUnit.Millimeter;
System\Drawing\FontConverterTests.cs (41)
46public void TestConvertFrom(string input, string expectedName, float expectedSize, GraphicsUnit expectedUnits, FontStyle expectedFontStyle) 100Font font = new($"Courier New", 8.25f, FontStyle.Regular, GraphicsUnit.Point); 142{ new Font("Courier", 1.0f, FontStyle.Regular, GraphicsUnit.Point), 2 }, 143{ new Font("Courier", 1.0f, FontStyle.Regular, GraphicsUnit.Inch), 4 }, 144{ new Font("Courier", 1.0f, FontStyle.Regular, GraphicsUnit.Pixel, gdiCharSet: 2 /* SYMBOL_CHARSET */), 5 }, 145{ new Font("Courier", 1.0f, FontStyle.Regular, GraphicsUnit.Point, gdiCharSet: 1 /* DEFAULT_CHARSET */), 2 }, 146{ new Font("Courier", 1.0f, FontStyle.Regular, GraphicsUnit.Pixel, gdiCharSet: 1 /* DEFAULT_CHARSET */, gdiVerticalFont: true), 6 }, 149public static TheoryData<string, string, float, GraphicsUnit, FontStyle> TestConvertFormData() 152new TheoryData<string, string, float, GraphicsUnit, FontStyle>() 154{ $"Courier New", "Courier New", 8.25f, GraphicsUnit.Point, FontStyle.Regular }, 155{ $"Courier New{Separator} 11", "Courier New", 11f, GraphicsUnit.Point, FontStyle.Regular }, 156{ $"Arial{Separator} 11px", "Arial", 11f, GraphicsUnit.Pixel, FontStyle.Regular }, 157{ $"Courier New{Separator} 11 px", "Courier New", 11f, GraphicsUnit.Pixel, FontStyle.Regular }, 158{ $"Courier New{Separator} 11 px{Separator} style=Regular", "Courier New", 11f, GraphicsUnit.Pixel, FontStyle.Regular }, 159{ $"Courier New{Separator} style=Bold", "Courier New", 8.25f, GraphicsUnit.Point, FontStyle.Bold }, 160{ $"Courier New{Separator} 11 px{Separator} style=Bold{Separator} Italic", "Courier New", 11f, GraphicsUnit.Pixel, FontStyle.Bold | FontStyle.Italic }, 161{ $"Courier New{Separator} 11 px{Separator} style=Regular, Italic", "Courier New", 11f, GraphicsUnit.Pixel, FontStyle.Regular | FontStyle.Italic }, 162{ $"Courier New{Separator} 11 px{Separator} style=Bold{Separator} Italic{Separator} Strikeout", "Courier New", 11f, GraphicsUnit.Pixel, FontStyle.Bold | FontStyle.Italic | FontStyle.Strikeout }, 163{ $"Arial{Separator} 11 px{Separator} style=Bold, Italic, Strikeout", "Arial", 11f, GraphicsUnit.Pixel, FontStyle.Bold | FontStyle.Italic | FontStyle.Strikeout }, 164{ $"11px", "Microsoft Sans Serif", 8.25f, GraphicsUnit.Point, FontStyle.Regular }, 165{ $"Style=Bold", "Microsoft Sans Serif", 8.25f, GraphicsUnit.Point, FontStyle.Regular }, 166{ $"arIAL{Separator} 10{Separator} style=bold", "Arial", 10f, GraphicsUnit.Point, FontStyle.Bold }, 167{ $"Arial{Separator} 10{Separator}", "Arial", 10f, GraphicsUnit.Point, FontStyle.Regular }, 168{ $"Arial{Separator}", "Arial", 8.25f, GraphicsUnit.Point, FontStyle.Regular }, 169{ $"Arial{Separator} 10{Separator} style=12", "Arial", 10f, GraphicsUnit.Point, FontStyle.Underline | FontStyle.Strikeout }, 170{ $"Courier New{Separator} Style=Bold", "Courier New", 8.25f, GraphicsUnit.Point, FontStyle.Bold }, // FullFramework style keyword is case sensitive. 171{ $"11px{Separator} Style=Bold", "Microsoft Sans Serif", 8.25f, GraphicsUnit.Point, FontStyle.Bold} 178data.Add($"{Separator} 10{Separator} style=bold", "", 10f, GraphicsUnit.Point, FontStyle.Bold); 182data.Add($"{Separator} 10{Separator} style=bold", "Microsoft Sans Serif", 10f, GraphicsUnit.Point, FontStyle.Bold); 227foreach (GraphicsUnit item in values) 229Assert.NotEqual(GraphicsUnit.Display, item); 234[InlineData("Display", GraphicsUnit.Display)] 235[InlineData("Document", GraphicsUnit.Document)] 236[InlineData("Inch", GraphicsUnit.Inch)] 237[InlineData("Millimeter", GraphicsUnit.Millimeter)] 238[InlineData("Pixel", GraphicsUnit.Pixel)] 239[InlineData("Point", GraphicsUnit.Point)] 240[InlineData("World", GraphicsUnit.World)] 241public void CanConvertFrom(string input, GraphicsUnit expected) 244GraphicsUnit value = (GraphicsUnit)converter.ConvertFrom(input);
System\Drawing\FontTests.cs (84)
65VerifyFont(font, fontFamily.Name, emSize, FontStyle.Regular, GraphicsUnit.Point, 1, false); 80VerifyFont(font, fontFamily.Name, emSize, FontStyle.Regular, GraphicsUnit.Point, 1, false); 107VerifyFont(font, fontFamily.Name, emSize, style, GraphicsUnit.Point, 1, false); 122VerifyFont(font, fontFamily.Name, emSize, style, GraphicsUnit.Point, 1, false); 132yield return new object[] { FontFamily.GenericMonospace, 1, GraphicsUnit.Document }; 133yield return new object[] { FontFamily.GenericSerif, 2, GraphicsUnit.Inch }; 134yield return new object[] { FontFamily.GenericSansSerif, 3, GraphicsUnit.Millimeter }; 135yield return new object[] { FontFamily.GenericSerif, 4, GraphicsUnit.Point }; 136yield return new object[] { FontFamily.GenericSerif, float.MaxValue, GraphicsUnit.Pixel }; 137yield return new object[] { FontFamily.GenericSerif, 16, GraphicsUnit.World }; 142public void Ctor_Family_Size_Unit(FontFamily fontFamily, float emSize, GraphicsUnit unit) 157public void Ctor_FamilyName_Size_Unit(FontFamily fontFamily, float emSize, GraphicsUnit unit) 172yield return new object[] { FontFamily.GenericMonospace, 1, FontStyle.Bold, GraphicsUnit.Document }; 173yield return new object[] { FontFamily.GenericSerif, 2, FontStyle.Italic, GraphicsUnit.Inch }; 174yield return new object[] { FontFamily.GenericSansSerif, 3, FontStyle.Regular, GraphicsUnit.Millimeter }; 175yield return new object[] { FontFamily.GenericSerif, 4, FontStyle.Strikeout, GraphicsUnit.Point }; 176yield return new object[] { FontFamily.GenericSerif, float.MaxValue, FontStyle.Underline, GraphicsUnit.Pixel }; 177yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)(-1), GraphicsUnit.World }; 178yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)int.MinValue, GraphicsUnit.Millimeter }; 179yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)int.MaxValue, GraphicsUnit.Millimeter }; 184public void Ctor_Family_Size_Style_Unit(FontFamily fontFamily, float emSize, FontStyle style, GraphicsUnit unit) 199public void Ctor_FamilyName_Size_Style_Unit(FontFamily fontFamily, float emSize, FontStyle style, GraphicsUnit unit) 214yield return new object[] { FontFamily.GenericMonospace, 1, FontStyle.Bold, GraphicsUnit.Document, 0 }; 215yield return new object[] { FontFamily.GenericSerif, 2, FontStyle.Italic, GraphicsUnit.Inch, 1 }; 216yield return new object[] { FontFamily.GenericSansSerif, 3, FontStyle.Regular, GraphicsUnit.Millimeter, 255 }; 217yield return new object[] { FontFamily.GenericSerif, 4, FontStyle.Strikeout, GraphicsUnit.Point, 10 }; 218yield return new object[] { FontFamily.GenericSerif, float.MaxValue, FontStyle.Underline, GraphicsUnit.Pixel, 10 }; 219yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)(-1), GraphicsUnit.World, 8 }; 220yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)int.MinValue, GraphicsUnit.Millimeter, 127 }; 221yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)int.MaxValue, GraphicsUnit.Millimeter, 200 }; 226public void Ctor_Family_Size_Style_Unit_GdiCharSet(FontFamily fontFamily, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet) 241public void Ctor_FamilyName_Size_Style_Unit_GdiCharSet(FontFamily fontFamily, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet) 256yield return new object[] { FontFamily.GenericMonospace, 1, FontStyle.Bold, GraphicsUnit.Document, 0, true }; 257yield return new object[] { FontFamily.GenericSerif, 2, FontStyle.Italic, GraphicsUnit.Inch, 1, false }; 258yield return new object[] { FontFamily.GenericSansSerif, 3, FontStyle.Regular, GraphicsUnit.Millimeter, 255, true }; 259yield return new object[] { FontFamily.GenericSerif, 4, FontStyle.Strikeout, GraphicsUnit.Point, 10, false }; 260yield return new object[] { FontFamily.GenericSerif, float.MaxValue, FontStyle.Underline, GraphicsUnit.Pixel, 10, true }; 261yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)(-1), GraphicsUnit.World, 8, false }; 262yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)int.MinValue, GraphicsUnit.Millimeter, 127, true }; 263yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)int.MaxValue, GraphicsUnit.Millimeter, 200, false }; 268public void Ctor_Family_Size_Style_Unit_GdiCharSet_GdiVerticalFont(FontFamily fontFamily, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont) 283public void Ctor_FamilyName_Size_Style_Unit_GdiCharSet_GdiVerticalFont(FontFamily fontFamily, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont) 328AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10, GraphicsUnit.Display)); 329AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10, FontStyle.Italic, GraphicsUnit.Display)); 330AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10, FontStyle.Italic, GraphicsUnit.Display, 10)); 331AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10, FontStyle.Italic, GraphicsUnit.Display, 10, gdiVerticalFont: true)); 345AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10, GraphicsUnit.Display)); 346AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10, FontStyle.Italic, GraphicsUnit.Display)); 347AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10, FontStyle.Italic, GraphicsUnit.Display, 10)); 348AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10, FontStyle.Italic, GraphicsUnit.Display, 10, gdiVerticalFont: true)); 364AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family, emSize, GraphicsUnit.Document)); 365AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family.Name, emSize, GraphicsUnit.Document)); 366AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family, emSize, FontStyle.Italic, GraphicsUnit.Document)); 367AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family.Name, emSize, FontStyle.Italic, GraphicsUnit.Document)); 368AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family, emSize, FontStyle.Italic, GraphicsUnit.Document, 10)); 369AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family.Name, emSize, FontStyle.Italic, GraphicsUnit.Document, 10)); 370AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family, emSize, FontStyle.Italic, GraphicsUnit.Document, 10, gdiVerticalFont: true)); 371AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family.Name, emSize, FontStyle.Italic, GraphicsUnit.Document, 10, gdiVerticalFont: true)); 375[InlineData(GraphicsUnit.Display)] 376[InlineData(GraphicsUnit.World - 1)] 377[InlineData(GraphicsUnit.Millimeter + 1)] 378public void Ctor_InvalidUnit_ThrowsArgumentException(GraphicsUnit unit) 395using Font font = new(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true); 420Font font = new(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true); 423yield return new object[] { font.Clone(), new Font(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true), false }; 424yield return new object[] { font.Clone(), new Font(family, 9, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true), false }; 425yield return new object[] { font.Clone(), new Font(family, 10, FontStyle.Italic, GraphicsUnit.Millimeter, 10, gdiVerticalFont: true), false }; 426yield return new object[] { font.Clone(), new Font(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 9, gdiVerticalFont: true), false }; 427yield return new object[] { font.Clone(), new Font(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: false), false }; 585VerifyFont(font, family.Name, font.Size, fontStyle, GraphicsUnit.World, charSet, expectedGdiVerticalFont: false); 677[InlineData(GraphicsUnit.Document)] 678[InlineData(GraphicsUnit.Inch)] 679[InlineData(GraphicsUnit.Millimeter)] 680[InlineData(GraphicsUnit.Pixel)] 681[InlineData(GraphicsUnit.Point)] 682[InlineData(GraphicsUnit.World)] 683public void SizeInPoints_Get_ReturnsExpected(GraphicsUnit unit) 688if (unit == GraphicsUnit.Point) 705using Font font = new(family, 10, fontStyle, GraphicsUnit.Point, gdiCharSet, gdiVerticalFont); 827using Font font = new(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true); 852using Font font = new(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true); 856private static void VerifyFont(Font font, string expectedName, float expectedEmSize, FontStyle expectedStyle, GraphicsUnit expectedUnit, byte expectedGdiCharset, bool expectedGdiVerticalFont) 879using Font font1 = new(family1, 1, FontStyle.Bold, GraphicsUnit.Point); 882using Font font2 = new(family2, 1, FontStyle.Bold, GraphicsUnit.Point);
System\Drawing\GraphicsTests.cs (14)
696[InlineData(GraphicsUnit.Display)] 697[InlineData(GraphicsUnit.Document)] 698[InlineData(GraphicsUnit.Inch)] 699[InlineData(GraphicsUnit.Millimeter)] 700[InlineData(GraphicsUnit.Pixel)] 701[InlineData(GraphicsUnit.Point)] 702public void PageUnit_SetValid_GetReturnsExpected(GraphicsUnit pageUnit) 711[InlineData(GraphicsUnit.World - 1)] 712[InlineData(GraphicsUnit.Millimeter + 1)] 713public void PageUnit_SetInvalid_ThrowsInvalidEnumArgumentException(GraphicsUnit pageUnit) 725AssertExtensions.Throws<ArgumentException>(null, () => graphics.PageUnit = GraphicsUnit.World); 737Assert.Throws<InvalidOperationException>(() => graphics.PageUnit = GraphicsUnit.Document); 753AssertExtensions.Throws<ArgumentException>(null, () => graphics.PageUnit = GraphicsUnit.Document); 2811Assert.Equal(GraphicsUnit.Display, graphics.PageUnit);
System\Drawing\Imaging\ImageAttributesTests.cs (51)
77graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, clone); 99graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 103graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 136graphicsBigBitmap.DrawImage(bitmapSmall, new Rectangle(0, 0, 100, 100), 0, 0, 100, 100, GraphicsUnit.Pixel, null); 137graphicsBigBitmap.DrawImage(bitmapSmall, new Rectangle(100, 0, 100, 100), 0, 0, 100, 100, GraphicsUnit.Pixel, imageAttr); 152graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 157graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 179graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 183graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 187graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 210graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 281graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 308graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 312graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 316graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 348graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 371graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 398graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 427graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 487graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 500graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 513graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 543graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 557graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 586graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 599graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 612graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 645graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 676graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 692graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 726graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 743graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 760graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 792graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 807graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 821graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 855graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 870graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 910graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 936graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 966graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 1016graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 1031graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 1062graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 1130graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 1146graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 1176graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 1189graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 1202graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 1254graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 1268graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
System\Drawing\Imaging\MetafileTests.cs (6)
964GraphicsUnit graphicsUnit = (GraphicsUnit)int.MaxValue; 972Assert.Equal(GraphicsUnit.Pixel, graphicsUnit); 984GraphicsUnit graphicsUnit = (GraphicsUnit)int.MaxValue; 988Assert.Equal(GraphicsUnit.Pixel, graphicsUnit);
System.Windows.Forms (35)
System\Windows\Forms\ActiveX\AxHost.cs (5)
3676if (font.Unit != GraphicsUnit.Point) 3710return f.Unit == GraphicsUnit.Point 3712: new(f.Name, f.SizeInPoints, f.Style, GraphicsUnit.Point, f.GdiCharSet, f.GdiVerticalFont); 3731if (font.Unit != GraphicsUnit.Point) 3799GraphicsUnit.Point,
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (1)
3554graphics.DrawImage(s_errorBmp, iconBounds, 0, 0, s_iconsWidth, s_iconsHeight, GraphicsUnit.Pixel);
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (1)
840g.DrawImage(bmFlipXPThemes, backgroundBounds, new Rectangle(bmFlipXPThemes.Width - backgroundBounds.Width, 0, backgroundBounds.Width, backgroundBounds.Height), GraphicsUnit.Pixel);
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.cs (1)
832g.DrawImage(image, imageBounds, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, attr);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (3)
711GraphicsUnit.Pixel); 1049g.DrawImage(invertedBitmap, bmpRect, 0, 0, s_iconsWidth, s_iconsHeight, GraphicsUnit.Pixel, attr); 1053g.DrawImage(bmp, bmpRect, 0, 0, s_iconsWidth, s_iconsHeight, GraphicsUnit.Pixel, attr);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\DropDownButton.DropDownButtonAdapter.cs (2)
94graphics.DrawImage(invertedImage, imageBounds, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, new ImageAttributes()); 98graphics.DrawImage(image, imageBounds, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, new ImageAttributes());
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (1)
1718graphics.DrawImage(bitmap, rectangle, 0, 0, bitmap.Width, bitmap.Height, GraphicsUnit.Pixel);
System\Windows\Forms\Controls\RichTextBox\RichTextBox.cs (1)
2204return new Font(cf.FaceName.ToString(), fontSize, style, GraphicsUnit.Point, cf.bCharSet);
System\Windows\Forms\Controls\ToolStrips\ToolStripHighContrastRenderer.cs (2)
512g.DrawImage(image, imageRect, 0, 0, imageRect.Width, imageRect.Height, GraphicsUnit.Pixel, attrs); 516g.DrawImage(image, imageRect, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, attrs);
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.cs (2)
72if (sysFont.Unit != GraphicsUnit.Point) 108if (sysFont.Unit != GraphicsUnit.Point)
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (1)
769e.Graphics.DrawImage(image, imageRect, new Rectangle(Point.Empty, imageRect.Size), GraphicsUnit.Pixel);
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (3)
796e.Graphics.DrawImage(image, imageRect, new Rectangle(Point.Empty, imageRect.Size), GraphicsUnit.Pixel); 845imageRect.Height, GraphicsUnit.Pixel, e.ImageAttributes); 1041GraphicsUnit.Pixel,
System\Windows\Forms\Dialogs\CommonDialogs\FontDialog.cs (2)
144result = new Font(result.FontFamily, MinSize, result.Style, GraphicsUnit.Point); 149result = new Font(result.FontFamily, MaxSize, result.Style, GraphicsUnit.Point);
System\Windows\Forms\Rendering\ControlPaint.cs (9)
481GraphicsUnit.Pixel); 498GraphicsUnit.Pixel); 512GraphicsUnit.Pixel, 1467GraphicsUnit.Pixel, 1565GraphicsUnit.Pixel, 1583g.DrawImage(image, dest, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, attributes, null, 0); 1639GraphicsUnit.Pixel, 1651GraphicsUnit.Pixel, 2062GraphicsUnit.Point,
System\Windows\Forms\Rendering\DrawingEventArgs.cs (1)
111_graphics.PageUnit = GraphicsUnit.Pixel;
System.Windows.Forms.Design (6)
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.EditorButton.cs (1)
143GraphicsUnit.Pixel,
System\Drawing\Design\FontNameEditor.cs (1)
72using Font font = new(fontFamily, fontSize, fontStyle, GraphicsUnit.Pixel);
System\Windows\Forms\Design\Behavior\DragAssistanceManager.cs (2)
377_graphics.DrawImage(_backgroundImage, invalidRect, invalidRect, GraphicsUnit.Pixel); 397_graphics.DrawImage(_backgroundImage, invalidRect, invalidRect, GraphicsUnit.Pixel);
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (1)
1041GraphicsUnit.Pixel);
System\Windows\Forms\Design\ControlDesigner.cs (1)
2276GraphicsUnit.Pixel))
System.Windows.Forms.Primitives (1)
System\Windows\Forms\Internals\ScaleHelper.cs (1)
197graphics.DrawImage(bitmap, destinationBounds, sourceBounds, GraphicsUnit.Pixel);
System.Windows.Forms.Tests (31)
System\Windows\Forms\AxHostTests.cs (14)
1477using Font font = new("Arial", 10, FontStyle.Bold | FontStyle.Underline | FontStyle.Italic | FontStyle.Strikeout, GraphicsUnit.Point, 10); 1504[InlineData(GraphicsUnit.Document)] 1505[InlineData(GraphicsUnit.Inch)] 1506[InlineData(GraphicsUnit.Millimeter)] 1507[InlineData(GraphicsUnit.Pixel)] 1508[InlineData(GraphicsUnit.World)] 1509public void AxHost_GetIFontDispFromFont_InvalidFontUnit_ThrowsArgumentException(GraphicsUnit unit) 1546using Font font = new("Arial", 10, FontStyle.Bold | FontStyle.Underline | FontStyle.Italic | FontStyle.Strikeout, GraphicsUnit.Point, 10); 1565[InlineData(GraphicsUnit.Document)] 1566[InlineData(GraphicsUnit.Inch)] 1567[InlineData(GraphicsUnit.Millimeter)] 1568[InlineData(GraphicsUnit.Pixel)] 1569[InlineData(GraphicsUnit.World)] 1570public void AxHost_GetIFontFromFont_InvalidFontUnit_ThrowsArgumentException(GraphicsUnit unit)
System\Windows\Forms\Control.ActiveXFontMarshallerTests.cs (1)
20using Font font = new("Arial", 11.0f, GraphicsUnit.Point);
System\Windows\Forms\FontDialogTests.cs (2)
255Assert.Equal(GraphicsUnit.Point, result.Unit); 273Assert.Equal(GraphicsUnit.Point, result.Unit);
System\Windows\Forms\Ole\BinaryFormatUtilitiesTests.cs (2)
76(typeof(GraphicsUnit).FullName, typeof(GraphicsUnit)),
System\Windows\Forms\RichTextBoxTests.cs (12)
1583yield return new object[] { "Arial", 8.25f, FontStyle.Regular, GraphicsUnit.Point, 1, 165, 0 }; 1584yield return new object[] { "Arial", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 1, 165, CFE_EFFECTS.CFE_BOLD }; 1585yield return new object[] { "Arial", 8.25f, FontStyle.Italic, GraphicsUnit.Point, 1, 165, CFE_EFFECTS.CFE_ITALIC }; 1586yield return new object[] { "Arial", 8.25f, FontStyle.Strikeout, GraphicsUnit.Point, 1, 165, CFE_EFFECTS.CFE_STRIKEOUT }; 1587yield return new object[] { "Arial", 8.25f, FontStyle.Underline, GraphicsUnit.Point, 1, 165, CFE_EFFECTS.CFE_UNDERLINE }; 1588yield return new object[] { "Arial", 8.25f, FontStyle.Bold | FontStyle.Italic | FontStyle.Regular | FontStyle.Strikeout | FontStyle.Underline, GraphicsUnit.Point, 10, 165, CFE_EFFECTS.CFE_BOLD | CFE_EFFECTS.CFE_ITALIC | CFE_EFFECTS.CFE_UNDERLINE | CFE_EFFECTS.CFE_STRIKEOUT }; 1593public unsafe void RichTextBox_Font_GetCharFormat_Success(string familyName, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet, int expectedYHeight, int expectedEffects) 4760Assert.Equal(GraphicsUnit.Point, font.Unit); 4817yield return new object[] { "Arial", 8.25f, true, FontStyle.Bold | FontStyle.Italic | FontStyle.Regular | FontStyle.Strikeout | FontStyle.Underline, GraphicsUnit.Point, 10, 1 }; 4822public void RichTextBox_SelectionFont_Set_GetReturnsExpected(string fontName, float fontSize, bool hasStyle, FontStyle fontStyle, GraphicsUnit units, byte gdiCharSet, byte expectedGdiCharset) 4849public void RichTextBox_SelectionFont_SetWithHandle_GetReturnsExpected(string fontName, float fontSize, bool hasStyle, FontStyle fontStyle, GraphicsUnit units, byte gdiCharSet, byte expectedGdiCharset) 4922yield return new object[] { new Font("Arial", 8.25f, FontStyle.Bold | FontStyle.Italic | FontStyle.Regular | FontStyle.Strikeout | FontStyle.Underline, GraphicsUnit.Point, 10), 165, CFE_EFFECTS.CFE_BOLD | CFE_EFFECTS.CFE_ITALIC | CFE_EFFECTS.CFE_UNDERLINE | CFE_EFFECTS.CFE_STRIKEOUT };
System.Windows.Forms.UI.IntegrationTests (1)
Dpi\ToolStripItemTests.Dpi.cs (1)
45using Font initialFont = toolStrip.Font = new("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
WinFormsControlsTest (7)
DataGridViewInVirtualModeTest.Designer.cs (1)
87this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
DataGridViewTest.Designer.cs (5)
58dataGridViewCellStyle1.Font = new System.Drawing.Font("Cascadia Code", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); 76dataGridViewCellStyle3.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(204))); 148this.changeFontButton.Font = new System.Drawing.Font("Consolas", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(204))); 196this.resetFontButton.Font = new System.Drawing.Font("Consolas", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(204))); 216this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
MultipleControls.Designer.cs (1)
109this.richTextBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);