400 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 (51)
Special\NotSupported.cs (51)
304
public Font(System.Drawing.FontFamily family, float emSize, System.Drawing.FontStyle style, System.Drawing.
GraphicsUnit
unit) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
305
public Font(System.Drawing.FontFamily family, float emSize, System.Drawing.FontStyle style, System.Drawing.
GraphicsUnit
unit, byte gdiCharSet) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
306
public Font(System.Drawing.FontFamily family, float emSize, System.Drawing.FontStyle style, System.Drawing.
GraphicsUnit
unit, byte gdiCharSet, bool gdiVerticalFont) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
307
public Font(System.Drawing.FontFamily family, float emSize, System.Drawing.
GraphicsUnit
unit) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
310
public Font(string familyName, float emSize, System.Drawing.FontStyle style, System.Drawing.
GraphicsUnit
unit) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
311
public Font(string familyName, float emSize, System.Drawing.FontStyle style, System.Drawing.
GraphicsUnit
unit, byte gdiCharSet) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
312
public Font(string familyName, float emSize, System.Drawing.FontStyle style, System.Drawing.
GraphicsUnit
unit, byte gdiCharSet, bool gdiVerticalFont) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
313
public Font(string familyName, float emSize, System.Drawing.
GraphicsUnit
unit) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
346
public System.Drawing.
GraphicsUnit
Unit { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } }
444
public System.Drawing.
GraphicsUnit
PageUnit { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } set { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } }
454
public System.Drawing.Drawing2D.GraphicsContainer BeginContainer(System.Drawing.Rectangle dstrect, System.Drawing.Rectangle srcrect, System.Drawing.
GraphicsUnit
unit) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
455
public System.Drawing.Drawing2D.GraphicsContainer BeginContainer(System.Drawing.RectangleF dstrect, System.Drawing.RectangleF srcrect, System.Drawing.
GraphicsUnit
unit) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
492
public 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); }
493
public 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); }
494
public 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); }
495
public 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); }
497
public void DrawImage(System.Drawing.Image image, System.Drawing.Point[] destPoints, System.Drawing.Rectangle srcRect, System.Drawing.
GraphicsUnit
srcUnit) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
498
public void DrawImage(System.Drawing.Image image, System.Drawing.Point[] destPoints, System.Drawing.Rectangle srcRect, System.Drawing.
GraphicsUnit
srcUnit, System.Drawing.Imaging.ImageAttributes? imageAttr) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
499
public void DrawImage(System.Drawing.Image image, System.Drawing.Point[] destPoints, System.Drawing.Rectangle srcRect, System.Drawing.
GraphicsUnit
srcUnit, System.Drawing.Imaging.ImageAttributes? imageAttr, System.Drawing.Graphics.DrawImageAbort? callback) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
500
public void DrawImage(System.Drawing.Image image, System.Drawing.Point[] destPoints, System.Drawing.Rectangle 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); }
502
public void DrawImage(System.Drawing.Image image, System.Drawing.Rectangle destRect, System.Drawing.Rectangle srcRect, System.Drawing.
GraphicsUnit
srcUnit) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
503
public void DrawImage(System.Drawing.Image image, System.Drawing.Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, System.Drawing.
GraphicsUnit
srcUnit) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
504
public void DrawImage(System.Drawing.Image image, System.Drawing.Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, System.Drawing.
GraphicsUnit
srcUnit, System.Drawing.Imaging.ImageAttributes? imageAttr) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
505
public void DrawImage(System.Drawing.Image image, System.Drawing.Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, System.Drawing.
GraphicsUnit
srcUnit, System.Drawing.Imaging.ImageAttributes? imageAttr, System.Drawing.Graphics.DrawImageAbort? callback) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
506
public void DrawImage(System.Drawing.Image image, System.Drawing.Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, System.Drawing.
GraphicsUnit
srcUnit, System.Drawing.Imaging.ImageAttributes? imageAttrs, System.Drawing.Graphics.DrawImageAbort? callback, System.IntPtr callbackData) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
507
public void DrawImage(System.Drawing.Image image, System.Drawing.Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, System.Drawing.
GraphicsUnit
srcUnit) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
508
public void DrawImage(System.Drawing.Image image, System.Drawing.Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, System.Drawing.
GraphicsUnit
srcUnit, System.Drawing.Imaging.ImageAttributes? imageAttrs) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
509
public void DrawImage(System.Drawing.Image image, System.Drawing.Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, System.Drawing.
GraphicsUnit
srcUnit, System.Drawing.Imaging.ImageAttributes? imageAttrs, System.Drawing.Graphics.DrawImageAbort? callback) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
510
public void DrawImage(System.Drawing.Image image, System.Drawing.Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, System.Drawing.
GraphicsUnit
srcUnit, System.Drawing.Imaging.ImageAttributes? imageAttrs, System.Drawing.Graphics.DrawImageAbort? callback, System.IntPtr callbackData) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
512
public void DrawImage(System.Drawing.Image image, System.Drawing.RectangleF destRect, System.Drawing.RectangleF srcRect, System.Drawing.
GraphicsUnit
srcUnit) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
514
public void DrawImage(System.Drawing.Image image, int x, int y, System.Drawing.Rectangle srcRect, System.Drawing.
GraphicsUnit
srcUnit) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
517
public void DrawImage(System.Drawing.Image image, float x, float y, System.Drawing.RectangleF srcRect, System.Drawing.
GraphicsUnit
srcUnit) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
552
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Point destPoint, System.Drawing.Rectangle srcRect, System.Drawing.
GraphicsUnit
srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
553
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Point destPoint, System.Drawing.Rectangle srcRect, System.Drawing.
GraphicsUnit
srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
554
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Point destPoint, System.Drawing.Rectangle 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); }
558
public 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); }
559
public 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); }
560
public 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); }
564
public 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); }
565
public 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); }
566
public 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); }
570
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Point[] destPoints, System.Drawing.Rectangle srcRect, System.Drawing.
GraphicsUnit
srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
571
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Point[] destPoints, System.Drawing.Rectangle srcRect, System.Drawing.
GraphicsUnit
srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
572
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Point[] destPoints, System.Drawing.Rectangle 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); }
576
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Rectangle destRect, System.Drawing.Rectangle srcRect, System.Drawing.
GraphicsUnit
srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
577
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Rectangle destRect, System.Drawing.Rectangle srcRect, System.Drawing.
GraphicsUnit
srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
578
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Rectangle destRect, System.Drawing.Rectangle 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); }
582
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.RectangleF destRect, System.Drawing.RectangleF srcRect, System.Drawing.
GraphicsUnit
srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
583
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.RectangleF destRect, System.Drawing.RectangleF srcRect, System.Drawing.
GraphicsUnit
srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
584
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.RectangleF destRect, 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); }
785
public System.Drawing.RectangleF GetBounds(ref System.Drawing.
GraphicsUnit
pageUnit) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
System.Drawing.Common.Tests (268)
mono\System.Drawing.Imaging\BmpCodecTests.cs (10)
45
GraphicsUnit
unit =
GraphicsUnit
.World;
111
GraphicsUnit
unit =
GraphicsUnit
.World;
177
GraphicsUnit
unit =
GraphicsUnit
.World;
364
GraphicsUnit
unit =
GraphicsUnit
.World;
495
GraphicsUnit
unit =
GraphicsUnit
.World;
mono\System.Drawing.Imaging\GifCodecTests.cs (2)
42
GraphicsUnit
unit =
GraphicsUnit
.World;
mono\System.Drawing.Imaging\IconCodecTests.cs (12)
69
GraphicsUnit
unit =
GraphicsUnit
.World;
218
GraphicsUnit
unit =
GraphicsUnit
.World;
423
GraphicsUnit
unit =
GraphicsUnit
.World;
645
GraphicsUnit
unit =
GraphicsUnit
.World;
903
GraphicsUnit
unit =
GraphicsUnit
.World;
1836
GraphicsUnit
unit =
GraphicsUnit
.World;
mono\System.Drawing.Imaging\JpegCodecTests.cs (4)
44
GraphicsUnit
unit =
GraphicsUnit
.World;
171
GraphicsUnit
unit =
GraphicsUnit
.World;
mono\System.Drawing.Imaging\PngCodecTests.cs (6)
44
GraphicsUnit
unit =
GraphicsUnit
.World;
246
GraphicsUnit
unit =
GraphicsUnit
.World;
354
GraphicsUnit
unit =
GraphicsUnit
.World;
mono\System.Drawing.Imaging\TiffCodecTests.cs (2)
44
GraphicsUnit
unit =
GraphicsUnit
.World;
mono\System.Drawing\GraphicsTests.cs (35)
111
Assert.Equal(
GraphicsUnit
.Display, g.PageUnit);
127
g.PageUnit =
GraphicsUnit
.Inch;
138
Assert.Equal(
GraphicsUnit
.Inch, g.PageUnit);
290
g.PageUnit =
GraphicsUnit
.Inch;
303
g.PageUnit =
GraphicsUnit
.Display;
316
Assert.Equal(
GraphicsUnit
.Inch, g.PageUnit);
330
Assert.Equal(
GraphicsUnit
.Display, g.PageUnit);
912
AssertEquals(message + ".PageUnit",
GraphicsUnit
.Display, g.PageUnit);
927
AssertEquals(message + ".PageUnit",
GraphicsUnit
.Inch, g.PageUnit);
960
g.PageUnit =
GraphicsUnit
.Inch;
993
g.PageUnit =
GraphicsUnit
.Inch;
1003
GraphicsContainer gc = g.BeginContainer(new Rectangle(10, 20, 30, 40), new Rectangle(10, 20, 300, 400),
GraphicsUnit
.Millimeter);
1027
g.PageUnit =
GraphicsUnit
.Inch;
1037
GraphicsContainer gc = g.BeginContainer(new RectangleF(40, 30, 20, 10), new RectangleF(10, 20, 30, 40),
GraphicsUnit
.Inch);
1047
private static void BeginContainer_GraphicsUnit(
GraphicsUnit
unit)
1057
Assert.Throws<ArgumentException>(() => BeginContainer_GraphicsUnit(
GraphicsUnit
.Display));
1063
BeginContainer_GraphicsUnit(
GraphicsUnit
.Document);
1064
BeginContainer_GraphicsUnit(
GraphicsUnit
.Inch);
1065
BeginContainer_GraphicsUnit(
GraphicsUnit
.Millimeter);
1066
BeginContainer_GraphicsUnit(
GraphicsUnit
.Pixel);
1067
BeginContainer_GraphicsUnit(
GraphicsUnit
.Point);
1073
Assert.Throws<ArgumentException>(() => BeginContainer_GraphicsUnit(
GraphicsUnit
.World));
1079
Assert.Throws<ArgumentException>(() => BeginContainer_GraphicsUnit((
GraphicsUnit
)int.MinValue));
1108
g.PageUnit =
GraphicsUnit
.Inch;
2591
Assert.Throws<ArgumentNullException>(() => g.DrawImage(null, default(Rectangle), default,
GraphicsUnit
.Display));
2594
private static void DrawImage_ImageRectangleRectangleGraphicsUnit(
GraphicsUnit
unit)
2605
Assert.Throws<ArgumentException>(() => DrawImage_ImageRectangleRectangleGraphicsUnit(
GraphicsUnit
.Display));
2612
DrawImage_ImageRectangleRectangleGraphicsUnit(
GraphicsUnit
.Pixel);
2618
Assert.Throws<ArgumentException>(() => DrawImage_ImageRectangleRectangleGraphicsUnit(
GraphicsUnit
.World));
2628
Assert.Throws<ArgumentNullException>(() => g.DrawImage(null, pts, r,
GraphicsUnit
.Pixel));
2636
g.DrawImage(bmp, pts, r,
GraphicsUnit
.Pixel);
2686
Assert.Throws<ArgumentNullException>(() => g.DrawImage(null, pts, r,
GraphicsUnit
.Pixel));
2694
g.DrawImage(bmp, pts, r,
GraphicsUnit
.Pixel);
2745
g.DrawImage(bmp, pts, r,
GraphicsUnit
.Pixel, null);
2757
g.DrawImage(bmp, pts, r,
GraphicsUnit
.Pixel, ia);
System\Drawing\Drawing2D\GraphicsPathTests.cs (1)
1782
graphics.PageUnit =
GraphicsUnit
.Millimeter;
System\Drawing\FontConverterTests.cs (41)
46
public void TestConvertFrom(string input, string expectedName, float expectedSize,
GraphicsUnit
expectedUnits, FontStyle expectedFontStyle)
100
Font 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 },
149
public static TheoryData<string, string, float,
GraphicsUnit
, FontStyle> TestConvertFormData()
152
new 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}
178
data.Add($"{Separator} 10{Separator} style=bold", "", 10f,
GraphicsUnit
.Point, FontStyle.Bold);
182
data.Add($"{Separator} 10{Separator} style=bold", "Microsoft Sans Serif", 10f,
GraphicsUnit
.Point, FontStyle.Bold);
227
foreach (
GraphicsUnit
item in values)
229
Assert.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)]
241
public void CanConvertFrom(string input,
GraphicsUnit
expected)
244
GraphicsUnit
value = (
GraphicsUnit
)converter.ConvertFrom(input);
System\Drawing\FontTests.cs (84)
65
VerifyFont(font, fontFamily.Name, emSize, FontStyle.Regular,
GraphicsUnit
.Point, 1, false);
80
VerifyFont(font, fontFamily.Name, emSize, FontStyle.Regular,
GraphicsUnit
.Point, 1, false);
107
VerifyFont(font, fontFamily.Name, emSize, style,
GraphicsUnit
.Point, 1, false);
122
VerifyFont(font, fontFamily.Name, emSize, style,
GraphicsUnit
.Point, 1, false);
132
yield return new object[] { FontFamily.GenericMonospace, 1,
GraphicsUnit
.Document };
133
yield return new object[] { FontFamily.GenericSerif, 2,
GraphicsUnit
.Inch };
134
yield return new object[] { FontFamily.GenericSansSerif, 3,
GraphicsUnit
.Millimeter };
135
yield return new object[] { FontFamily.GenericSerif, 4,
GraphicsUnit
.Point };
136
yield return new object[] { FontFamily.GenericSerif, float.MaxValue,
GraphicsUnit
.Pixel };
137
yield return new object[] { FontFamily.GenericSerif, 16,
GraphicsUnit
.World };
142
public void Ctor_Family_Size_Unit(FontFamily fontFamily, float emSize,
GraphicsUnit
unit)
157
public void Ctor_FamilyName_Size_Unit(FontFamily fontFamily, float emSize,
GraphicsUnit
unit)
172
yield return new object[] { FontFamily.GenericMonospace, 1, FontStyle.Bold,
GraphicsUnit
.Document };
173
yield return new object[] { FontFamily.GenericSerif, 2, FontStyle.Italic,
GraphicsUnit
.Inch };
174
yield return new object[] { FontFamily.GenericSansSerif, 3, FontStyle.Regular,
GraphicsUnit
.Millimeter };
175
yield return new object[] { FontFamily.GenericSerif, 4, FontStyle.Strikeout,
GraphicsUnit
.Point };
176
yield return new object[] { FontFamily.GenericSerif, float.MaxValue, FontStyle.Underline,
GraphicsUnit
.Pixel };
177
yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)(-1),
GraphicsUnit
.World };
178
yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)int.MinValue,
GraphicsUnit
.Millimeter };
179
yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)int.MaxValue,
GraphicsUnit
.Millimeter };
184
public void Ctor_Family_Size_Style_Unit(FontFamily fontFamily, float emSize, FontStyle style,
GraphicsUnit
unit)
199
public void Ctor_FamilyName_Size_Style_Unit(FontFamily fontFamily, float emSize, FontStyle style,
GraphicsUnit
unit)
214
yield return new object[] { FontFamily.GenericMonospace, 1, FontStyle.Bold,
GraphicsUnit
.Document, 0 };
215
yield return new object[] { FontFamily.GenericSerif, 2, FontStyle.Italic,
GraphicsUnit
.Inch, 1 };
216
yield return new object[] { FontFamily.GenericSansSerif, 3, FontStyle.Regular,
GraphicsUnit
.Millimeter, 255 };
217
yield return new object[] { FontFamily.GenericSerif, 4, FontStyle.Strikeout,
GraphicsUnit
.Point, 10 };
218
yield return new object[] { FontFamily.GenericSerif, float.MaxValue, FontStyle.Underline,
GraphicsUnit
.Pixel, 10 };
219
yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)(-1),
GraphicsUnit
.World, 8 };
220
yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)int.MinValue,
GraphicsUnit
.Millimeter, 127 };
221
yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)int.MaxValue,
GraphicsUnit
.Millimeter, 200 };
226
public void Ctor_Family_Size_Style_Unit_GdiCharSet(FontFamily fontFamily, float emSize, FontStyle style,
GraphicsUnit
unit, byte gdiCharSet)
241
public void Ctor_FamilyName_Size_Style_Unit_GdiCharSet(FontFamily fontFamily, float emSize, FontStyle style,
GraphicsUnit
unit, byte gdiCharSet)
256
yield return new object[] { FontFamily.GenericMonospace, 1, FontStyle.Bold,
GraphicsUnit
.Document, 0, true };
257
yield return new object[] { FontFamily.GenericSerif, 2, FontStyle.Italic,
GraphicsUnit
.Inch, 1, false };
258
yield return new object[] { FontFamily.GenericSansSerif, 3, FontStyle.Regular,
GraphicsUnit
.Millimeter, 255, true };
259
yield return new object[] { FontFamily.GenericSerif, 4, FontStyle.Strikeout,
GraphicsUnit
.Point, 10, false };
260
yield return new object[] { FontFamily.GenericSerif, float.MaxValue, FontStyle.Underline,
GraphicsUnit
.Pixel, 10, true };
261
yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)(-1),
GraphicsUnit
.World, 8, false };
262
yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)int.MinValue,
GraphicsUnit
.Millimeter, 127, true };
263
yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)int.MaxValue,
GraphicsUnit
.Millimeter, 200, false };
268
public void Ctor_Family_Size_Style_Unit_GdiCharSet_GdiVerticalFont(FontFamily fontFamily, float emSize, FontStyle style,
GraphicsUnit
unit, byte gdiCharSet, bool gdiVerticalFont)
283
public void Ctor_FamilyName_Size_Style_Unit_GdiCharSet_GdiVerticalFont(FontFamily fontFamily, float emSize, FontStyle style,
GraphicsUnit
unit, byte gdiCharSet, bool gdiVerticalFont)
328
AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10,
GraphicsUnit
.Display));
329
AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10, FontStyle.Italic,
GraphicsUnit
.Display));
330
AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10, FontStyle.Italic,
GraphicsUnit
.Display, 10));
331
AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10, FontStyle.Italic,
GraphicsUnit
.Display, 10, gdiVerticalFont: true));
345
AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10,
GraphicsUnit
.Display));
346
AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10, FontStyle.Italic,
GraphicsUnit
.Display));
347
AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10, FontStyle.Italic,
GraphicsUnit
.Display, 10));
348
AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10, FontStyle.Italic,
GraphicsUnit
.Display, 10, gdiVerticalFont: true));
364
AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family, emSize,
GraphicsUnit
.Document));
365
AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family.Name, emSize,
GraphicsUnit
.Document));
366
AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family, emSize, FontStyle.Italic,
GraphicsUnit
.Document));
367
AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family.Name, emSize, FontStyle.Italic,
GraphicsUnit
.Document));
368
AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family, emSize, FontStyle.Italic,
GraphicsUnit
.Document, 10));
369
AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family.Name, emSize, FontStyle.Italic,
GraphicsUnit
.Document, 10));
370
AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family, emSize, FontStyle.Italic,
GraphicsUnit
.Document, 10, gdiVerticalFont: true));
371
AssertExtensions.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)]
378
public void Ctor_InvalidUnit_ThrowsArgumentException(
GraphicsUnit
unit)
395
using Font font = new(family, 10, FontStyle.Bold,
GraphicsUnit
.Inch, 10, gdiVerticalFont: true);
420
Font font = new(family, 10, FontStyle.Bold,
GraphicsUnit
.Inch, 10, gdiVerticalFont: true);
423
yield return new object[] { font.Clone(), new Font(family, 10, FontStyle.Bold,
GraphicsUnit
.Inch, 10, gdiVerticalFont: true), false };
424
yield return new object[] { font.Clone(), new Font(family, 9, FontStyle.Bold,
GraphicsUnit
.Inch, 10, gdiVerticalFont: true), false };
425
yield return new object[] { font.Clone(), new Font(family, 10, FontStyle.Italic,
GraphicsUnit
.Millimeter, 10, gdiVerticalFont: true), false };
426
yield return new object[] { font.Clone(), new Font(family, 10, FontStyle.Bold,
GraphicsUnit
.Inch, 9, gdiVerticalFont: true), false };
427
yield return new object[] { font.Clone(), new Font(family, 10, FontStyle.Bold,
GraphicsUnit
.Inch, 10, gdiVerticalFont: false), false };
585
VerifyFont(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)]
683
public void SizeInPoints_Get_ReturnsExpected(
GraphicsUnit
unit)
688
if (unit ==
GraphicsUnit
.Point)
705
using Font font = new(family, 10, fontStyle,
GraphicsUnit
.Point, gdiCharSet, gdiVerticalFont);
827
using Font font = new(family, 10, FontStyle.Bold,
GraphicsUnit
.Inch, 10, gdiVerticalFont: true);
852
using Font font = new(family, 10, FontStyle.Bold,
GraphicsUnit
.Inch, 10, gdiVerticalFont: true);
856
private static void VerifyFont(Font font, string expectedName, float expectedEmSize, FontStyle expectedStyle,
GraphicsUnit
expectedUnit, byte expectedGdiCharset, bool expectedGdiVerticalFont)
879
using Font font1 = new(family1, 1, FontStyle.Bold,
GraphicsUnit
.Point);
882
using 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)]
702
public void PageUnit_SetValid_GetReturnsExpected(
GraphicsUnit
pageUnit)
711
[InlineData(
GraphicsUnit
.World - 1)]
712
[InlineData(
GraphicsUnit
.Millimeter + 1)]
713
public void PageUnit_SetInvalid_ThrowsInvalidEnumArgumentException(
GraphicsUnit
pageUnit)
725
AssertExtensions.Throws<ArgumentException>(null, () => graphics.PageUnit =
GraphicsUnit
.World);
737
Assert.Throws<InvalidOperationException>(() => graphics.PageUnit =
GraphicsUnit
.Document);
753
AssertExtensions.Throws<ArgumentException>(null, () => graphics.PageUnit =
GraphicsUnit
.Document);
2811
Assert.Equal(
GraphicsUnit
.Display, graphics.PageUnit);
System\Drawing\Imaging\ImageAttributesTests.cs (51)
77
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, clone);
99
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
103
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
136
graphicsBigBitmap.DrawImage(bitmapSmall, new Rectangle(0, 0, 100, 100), 0, 0, 100, 100,
GraphicsUnit
.Pixel, null);
137
graphicsBigBitmap.DrawImage(bitmapSmall, new Rectangle(100, 0, 100, 100), 0, 0, 100, 100,
GraphicsUnit
.Pixel, imageAttr);
152
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
157
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
179
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
183
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
187
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
210
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
281
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
308
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
312
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
316
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
348
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
371
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
398
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
427
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
487
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
500
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
513
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
543
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
557
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
586
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
599
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
612
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
645
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
676
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
692
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
726
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
743
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
760
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
792
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
807
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
821
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
855
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
870
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
910
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
936
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
966
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
1016
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
1031
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
1062
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
1130
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
1146
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
1176
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
1189
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
1202
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
1254
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
1268
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height,
GraphicsUnit
.Pixel, imageAttr);
System\Drawing\Imaging\MetafileTests.cs (6)
961
GraphicsUnit
graphicsUnit = (
GraphicsUnit
)int.MaxValue;
969
Assert.Equal(
GraphicsUnit
.Pixel, graphicsUnit);
981
GraphicsUnit
graphicsUnit = (
GraphicsUnit
)int.MaxValue;
985
Assert.Equal(
GraphicsUnit
.Pixel, graphicsUnit);
System.Windows.Forms (35)
System\Windows\Forms\ActiveX\AxHost.cs (5)
3676
if (font.Unit !=
GraphicsUnit
.Point)
3710
return f.Unit ==
GraphicsUnit
.Point
3712
: new(f.Name, f.SizeInPoints, f.Style,
GraphicsUnit
.Point, f.GdiCharSet, f.GdiVerticalFont);
3731
if (font.Unit !=
GraphicsUnit
.Point)
3799
GraphicsUnit
.Point,
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (1)
3552
graphics.DrawImage(s_errorBmp, iconBounds, 0, 0, s_iconsWidth, s_iconsHeight,
GraphicsUnit
.Pixel);
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (1)
840
g.DrawImage(bmFlipXPThemes, backgroundBounds, new Rectangle(bmFlipXPThemes.Width - backgroundBounds.Width, 0, backgroundBounds.Width, backgroundBounds.Height),
GraphicsUnit
.Pixel);
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.cs (1)
832
g.DrawImage(image, imageBounds, 0, 0, image.Width, image.Height,
GraphicsUnit
.Pixel, attr);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (3)
707
GraphicsUnit
.Pixel);
1045
g.DrawImage(invertedBitmap, bmpRect, 0, 0, s_iconsWidth, s_iconsHeight,
GraphicsUnit
.Pixel, attr);
1049
g.DrawImage(bmp, bmpRect, 0, 0, s_iconsWidth, s_iconsHeight,
GraphicsUnit
.Pixel, attr);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\DropDownButton.DropDownButtonAdapter.cs (2)
94
graphics.DrawImage(invertedImage, imageBounds, 0, 0, image.Width, image.Height,
GraphicsUnit
.Pixel, new ImageAttributes());
98
graphics.DrawImage(image, imageBounds, 0, 0, image.Width, image.Height,
GraphicsUnit
.Pixel, new ImageAttributes());
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (1)
1724
graphics.DrawImage(bitmap, rectangle, 0, 0, bitmap.Width, bitmap.Height,
GraphicsUnit
.Pixel);
System\Windows\Forms\Controls\RichTextBox\RichTextBox.cs (1)
2204
return new Font(cf.FaceName.ToString(), fontSize, style,
GraphicsUnit
.Point, cf.bCharSet);
System\Windows\Forms\Controls\ToolStrips\ToolStripHighContrastRenderer.cs (2)
512
g.DrawImage(image, imageRect, 0, 0, imageRect.Width, imageRect.Height,
GraphicsUnit
.Pixel, attrs);
516
g.DrawImage(image, imageRect, 0, 0, image.Width, image.Height,
GraphicsUnit
.Pixel, attrs);
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.cs (2)
73
if (sysFont.Unit !=
GraphicsUnit
.Point)
109
if (sysFont.Unit !=
GraphicsUnit
.Point)
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (1)
769
e.Graphics.DrawImage(image, imageRect, new Rectangle(Point.Empty, imageRect.Size),
GraphicsUnit
.Pixel);
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (3)
797
e.Graphics.DrawImage(image, imageRect, new Rectangle(Point.Empty, imageRect.Size),
GraphicsUnit
.Pixel);
846
imageRect.Height,
GraphicsUnit
.Pixel, e.ImageAttributes);
1042
GraphicsUnit
.Pixel,
System\Windows\Forms\Dialogs\CommonDialogs\FontDialog.cs (2)
144
result = new Font(result.FontFamily, MinSize, result.Style,
GraphicsUnit
.Point);
149
result = new Font(result.FontFamily, MaxSize, result.Style,
GraphicsUnit
.Point);
System\Windows\Forms\Rendering\ControlPaint.cs (9)
484
GraphicsUnit
.Pixel);
501
GraphicsUnit
.Pixel);
515
GraphicsUnit
.Pixel,
1471
GraphicsUnit
.Pixel,
1569
GraphicsUnit
.Pixel,
1587
g.DrawImage(image, dest, 0, 0, image.Width, image.Height,
GraphicsUnit
.Pixel, attributes, null, 0);
1643
GraphicsUnit
.Pixel,
1655
GraphicsUnit
.Pixel,
2066
GraphicsUnit
.Point,
System\Windows\Forms\Rendering\DrawingEventArgs.cs (1)
112
_graphics.PageUnit =
GraphicsUnit
.Pixel;
System.Windows.Forms.Design (6)
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.EditorButton.cs (1)
143
GraphicsUnit
.Pixel,
System\Drawing\Design\FontNameEditor.cs (1)
72
using 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)
1041
GraphicsUnit
.Pixel);
System\Windows\Forms\Design\ControlDesigner.cs (1)
2263
GraphicsUnit
.Pixel))
System.Windows.Forms.Primitives (1)
System\Windows\Forms\Internals\ScaleHelper.cs (1)
197
graphics.DrawImage(bitmap, destinationBounds, sourceBounds,
GraphicsUnit
.Pixel);
System.Windows.Forms.Tests (29)
System\Windows\Forms\AxHostTests.cs (14)
1475
using Font font = new("Arial", 10, FontStyle.Bold | FontStyle.Underline | FontStyle.Italic | FontStyle.Strikeout,
GraphicsUnit
.Point, 10);
1502
[InlineData(
GraphicsUnit
.Document)]
1503
[InlineData(
GraphicsUnit
.Inch)]
1504
[InlineData(
GraphicsUnit
.Millimeter)]
1505
[InlineData(
GraphicsUnit
.Pixel)]
1506
[InlineData(
GraphicsUnit
.World)]
1507
public void AxHost_GetIFontDispFromFont_InvalidFontUnit_ThrowsArgumentException(
GraphicsUnit
unit)
1544
using Font font = new("Arial", 10, FontStyle.Bold | FontStyle.Underline | FontStyle.Italic | FontStyle.Strikeout,
GraphicsUnit
.Point, 10);
1563
[InlineData(
GraphicsUnit
.Document)]
1564
[InlineData(
GraphicsUnit
.Inch)]
1565
[InlineData(
GraphicsUnit
.Millimeter)]
1566
[InlineData(
GraphicsUnit
.Pixel)]
1567
[InlineData(
GraphicsUnit
.World)]
1568
public void AxHost_GetIFontFromFont_InvalidFontUnit_ThrowsArgumentException(
GraphicsUnit
unit)
System\Windows\Forms\Control.ActiveXFontMarshallerTests.cs (1)
22
using Font font = new("Arial", 11.0f,
GraphicsUnit
.Point);
System\Windows\Forms\FontDialogTests.cs (2)
253
Assert.Equal(
GraphicsUnit
.Point, result.Unit);
271
Assert.Equal(
GraphicsUnit
.Point, result.Unit);
System\Windows\Forms\RichTextBoxTests.cs (12)
1581
yield return new object[] { "Arial", 8.25f, FontStyle.Regular,
GraphicsUnit
.Point, 1, 165, 0 };
1582
yield return new object[] { "Arial", 8.25f, FontStyle.Bold,
GraphicsUnit
.Point, 1, 165, CFE_EFFECTS.CFE_BOLD };
1583
yield return new object[] { "Arial", 8.25f, FontStyle.Italic,
GraphicsUnit
.Point, 1, 165, CFE_EFFECTS.CFE_ITALIC };
1584
yield return new object[] { "Arial", 8.25f, FontStyle.Strikeout,
GraphicsUnit
.Point, 1, 165, CFE_EFFECTS.CFE_STRIKEOUT };
1585
yield return new object[] { "Arial", 8.25f, FontStyle.Underline,
GraphicsUnit
.Point, 1, 165, CFE_EFFECTS.CFE_UNDERLINE };
1586
yield 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 };
1591
public unsafe void RichTextBox_Font_GetCharFormat_Success(string familyName, float emSize, FontStyle style,
GraphicsUnit
unit, byte gdiCharSet, int expectedYHeight, int expectedEffects)
4758
Assert.Equal(
GraphicsUnit
.Point, font.Unit);
4815
yield return new object[] { "Arial", 8.25f, true, FontStyle.Bold | FontStyle.Italic | FontStyle.Regular | FontStyle.Strikeout | FontStyle.Underline,
GraphicsUnit
.Point, 10, 1 };
4820
public void RichTextBox_SelectionFont_Set_GetReturnsExpected(string fontName, float fontSize, bool hasStyle, FontStyle fontStyle,
GraphicsUnit
units, byte gdiCharSet, byte expectedGdiCharset)
4847
public void RichTextBox_SelectionFont_SetWithHandle_GetReturnsExpected(string fontName, float fontSize, bool hasStyle, FontStyle fontStyle,
GraphicsUnit
units, byte gdiCharSet, byte expectedGdiCharset)
4920
yield 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)
45
using Font initialFont = toolStrip.Font = new("Segoe UI", 9F, FontStyle.Bold,
GraphicsUnit
.Point);
WinFormsControlsTest (7)
DataGridViewInVirtualModeTest.Designer.cs (1)
87
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.
GraphicsUnit
.Point, ((byte)(204)));
DataGridViewTest.Designer.cs (5)
58
dataGridViewCellStyle1.Font = new System.Drawing.Font("Cascadia Code", 12F, System.Drawing.FontStyle.Bold, System.Drawing.
GraphicsUnit
.Point, ((byte)(204)));
76
dataGridViewCellStyle3.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.
GraphicsUnit
.Point, ((byte)(204)));
148
this.changeFontButton.Font = new System.Drawing.Font("Consolas", 12F, System.Drawing.FontStyle.Italic, System.Drawing.
GraphicsUnit
.Point, ((byte)(204)));
196
this.resetFontButton.Font = new System.Drawing.Font("Consolas", 12F, System.Drawing.FontStyle.Italic, System.Drawing.
GraphicsUnit
.Point, ((byte)(204)));
216
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.
GraphicsUnit
.Point, ((byte)(204)));
MultipleControls.Designer.cs (1)
109
this.richTextBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.
GraphicsUnit
.Point);