173 instantiations of Metafile
PresentationFramework-SystemDrawing (3)
SystemDrawingExtension.cs (3)
35
internal override object GetMetafileFromHemf(nint hMetafile) => new
Metafile
(hMetafile, deleteEmf: false);
61
Metafile metafile =
new
(handle, deleteEmf: false);
91
Metafile metafile =
new
(metafileStream);
System.Drawing.Common (1)
System\Drawing\Image.cs (1)
861
GdiPlus.ImageType.ImageTypeMetafile => new
Metafile
((nint)nativeImage),
System.Drawing.Common.Tests (139)
mono\System.Imaging\MetafileTest.cs (12)
46
using Metafile mf =
new
(filename);
94
using Metafile mf =
new
(Helpers.GetTestBitmapPath(WmfPlaceable));
109
using Metafile mf =
new
(fs);
125
using Metafile mf =
new
(ms);
161
using Metafile mf =
new
(Helpers.GetTestBitmapPath(Emf));
170
using Metafile mf =
new
(fs);
180
using Metafile mf =
new
(ms);
221
Metafile mf =
new
(hdc, default(Rectangle));
238
Metafile mf =
new
(hdc, default(RectangleF));
254
Metafile mf =
new
(stream, hdc, type);
295
mf = new
Metafile
(hdc, EmfType.EmfPlusOnly);
337
mf = new
Metafile
(hdc, EmfType.EmfPlusOnly);
System\Drawing\GraphicsTests.cs (1)
285
using Metafile image =
new
(Helpers.GetTestBitmapPath("telescope_01.wmf"));
System\Drawing\Imaging\MetafileTests.cs (125)
43
AssertExtensions.Throws<ArgumentException>(null, () => new
Metafile
(IntPtr.Zero, false));
49
using Metafile metafile =
new
(GetPath(WmfFile));
50
Assert.Throws<ExternalException>(() => new
Metafile
(metafile.GetHenhmetafile(), false));
56
using Metafile metafile =
new
(GetPath(WmfFile));
63
Assert.Throws<ExternalException>(() => new
Metafile
(GetPath(BmpFile)));
69
AssertExtensions.Throws<ArgumentNullException>("path", () => new
Metafile
((string)null));
75
Assert.Throws<ExternalException>(() => new
Metafile
("fileNotExist"));
90
AssertExtensions.Throws<ArgumentException>("path", null, () => new
Metafile
(path));
97
using Metafile metafile =
new
(stream);
104
AssertExtensions.Throws<ArgumentNullException, ArgumentException>("stream", null, () => new
Metafile
((Stream)null));
111
Assert.Throws<ExternalException>(() => new
Metafile
(stream));
127
using Metafile metafile =
new
(g.GetHdc(), emfType);
146
AssertExtensions.Throws<ArgumentException>(null, () => new
Metafile
(g.GetHdc(), emfType));
152
AssertExtensions.Throws<ArgumentException>(null, () => new
Metafile
((IntPtr)null, EmfType.EmfOnly));
158
AssertExtensions.Throws<ArgumentException>(null, () => new
Metafile
(IntPtr.Zero, EmfType.EmfOnly));
173
using Metafile metafile =
new
(g.GetHdc(), EmfType.EmfOnly, description);
181
AssertExtensions.Throws<ArgumentException>(null, () => new
Metafile
(IntPtr.Zero, EmfType.EmfOnly, description));
189
using Metafile metafile =
new
(g.GetHdc(), _rectangleF);
209
using Metafile metafile =
new
(g.GetHdc(), _rectangleF, frameUnit);
219
using Metafile metafile =
new
(g.GetHdc(), _rectangleF, MetafileFrameUnit.Pixel, emfType);
230
using Metafile metafile =
new
(g.GetHdc(), _rectangleF, MetafileFrameUnit.Pixel, EmfType.EmfOnly, description);
239
using Metafile metafile =
new
(g.GetHdc(), _rectangle);
249
using Metafile metafile =
new
(g.GetHdc(), _rectangle, frameUnit);
259
using Metafile metafile =
new
(g.GetHdc(), _rectangle, MetafileFrameUnit.Pixel, emfType);
270
using Metafile metafile =
new
(g.GetHdc(), _rectangle, MetafileFrameUnit.Pixel, EmfType.EmfOnly, description);
277
AssertExtensions.Throws<ArgumentException>(null, () => new
Metafile
(IntPtr.Zero, _rectangleF));
278
AssertExtensions.Throws<ArgumentException>(null, () => new
Metafile
(IntPtr.Zero, _rectangleF, MetafileFrameUnit.Pixel));
280
new
Metafile
(IntPtr.Zero, _rectangleF, MetafileFrameUnit.Pixel, EmfType.EmfOnly));
282
new
Metafile
(IntPtr.Zero, _rectangleF, MetafileFrameUnit.Pixel, EmfType.EmfOnly, "description"));
284
AssertExtensions.Throws<ArgumentException>(null, () => new
Metafile
(IntPtr.Zero, _rectangle));
285
AssertExtensions.Throws<ArgumentException>(null, () => new
Metafile
(IntPtr.Zero, _rectangle, MetafileFrameUnit.Pixel));
287
new
Metafile
(IntPtr.Zero, _rectangle, MetafileFrameUnit.Pixel, EmfType.EmfOnly));
289
new
Metafile
(IntPtr.Zero, _rectangle, MetafileFrameUnit.Pixel, EmfType.EmfOnly, "description"));
307
AssertExtensions.Throws<ArgumentException>(null, () => new
Metafile
(referenceHdc, _rectangleF, farameUnit));
308
AssertExtensions.Throws<ArgumentException>(null, () => new
Metafile
(referenceHdc, _rectangleF, farameUnit, EmfType.EmfOnly));
310
new
Metafile
(referenceHdc, _rectangleF, farameUnit, EmfType.EmfOnly, "description"));
312
AssertExtensions.Throws<ArgumentException>(null, () => new
Metafile
(referenceHdc, _rectangle, farameUnit));
313
AssertExtensions.Throws<ArgumentException>(null, () => new
Metafile
(referenceHdc, _rectangle, farameUnit, EmfType.EmfOnly));
315
new
Metafile
(referenceHdc, _rectangle, farameUnit, EmfType.EmfOnly, "description"));
326
new
Metafile
(referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, emfType));
328
new
Metafile
(referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, emfType, "description"));
331
new
Metafile
(referenceHdc, _rectangle, MetafileFrameUnit.GdiCompatible, emfType));
333
new
Metafile
(referenceHdc, _rectangle, MetafileFrameUnit.GdiCompatible, emfType, "description"));
342
using (Metafile metafile =
new
(fileName, g.GetHdc()))
358
using (Metafile metafile =
new
(fileName, g.GetHdc(), emfType))
375
using (Metafile metafile =
new
(fileName, g.GetHdc(), EmfType.EmfPlusDual, description))
389
AssertExtensions.Throws<ArgumentException>(null, () => new
Metafile
(fileName, IntPtr.Zero));
390
AssertExtensions.Throws<ArgumentException>(null, () => new
Metafile
(fileName, IntPtr.Zero, EmfType.EmfOnly));
391
AssertExtensions.Throws<ArgumentException>(null, () => new
Metafile
(fileName, IntPtr.Zero, EmfType.EmfOnly, "description"));
403
AssertExtensions.Throws<ArgumentException>(null, () => new
Metafile
(fileName, referenceHdc, emfType));
404
AssertExtensions.Throws<ArgumentException>(null, () => new
Metafile
(fileName, referenceHdc, emfType, "description"));
414
AssertExtensions.Throws<ArgumentNullException>("path", () => new
Metafile
((string)null, referenceHdc));
415
AssertExtensions.Throws<ArgumentNullException>("path", () => new
Metafile
((string)null, referenceHdc, EmfType.EmfOnly));
416
AssertExtensions.Throws<ArgumentNullException>("path", () => new
Metafile
((string)null, referenceHdc, EmfType.EmfOnly, "description"));
427
AssertExtensions.Throws<ArgumentException>("path", null, () => new
Metafile
(fileName, referenceHdc));
428
AssertExtensions.Throws<ArgumentException>("path", null, () => new
Metafile
(fileName, referenceHdc, EmfType.EmfOnly));
429
AssertExtensions.Throws<ArgumentException>("path", null, () => new
Metafile
(fileName, referenceHdc, EmfType.EmfOnly, "description"));
439
Assert.Throws<PathTooLongException>(() => new
Metafile
(fileName, referenceHdc));
440
Assert.Throws<PathTooLongException>(() => new
Metafile
(fileName, referenceHdc, EmfType.EmfOnly));
441
Assert.Throws<PathTooLongException>(() => new
Metafile
(fileName, referenceHdc, EmfType.EmfOnly, "description"));
451
using (Metafile metafile =
new
(fileName, g.GetHdc(), _rectangleF))
467
using (Metafile metafile =
new
(fileName, g.GetHdc(), _rectangleF, frameUnit))
483
using (Metafile metafile =
new
(fileName, g.GetHdc(), _rectangleF, MetafileFrameUnit.GdiCompatible, emfType))
500
using (Metafile metafile =
new
(
518
using (Metafile metafile =
new
(
535
using (Metafile metafile =
new
(fileName, g.GetHdc(), _rectangle))
551
using (Metafile metafile =
new
(fileName, g.GetHdc(), _rectangle, frameUnit))
567
using (Metafile metafile =
new
(fileName, g.GetHdc(), _rectangle, MetafileFrameUnit.GdiCompatible, emfType))
584
using (Metafile metafile =
new
(
602
using (Metafile metafile =
new
(
617
AssertExtensions.Throws<ArgumentException>(null, () => new
Metafile
(fileName, IntPtr.Zero, _rectangleF));
618
AssertExtensions.Throws<ArgumentException>(null, () => new
Metafile
(fileName, IntPtr.Zero, _rectangleF, MetafileFrameUnit.GdiCompatible));
620
new
Metafile
(fileName, IntPtr.Zero, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly));
622
new
Metafile
(fileName, IntPtr.Zero, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly, "description"));
624
AssertExtensions.Throws<ArgumentException>(null, () => new
Metafile
(fileName, IntPtr.Zero, _rectangle));
625
AssertExtensions.Throws<ArgumentException>(null, () => new
Metafile
(fileName, IntPtr.Zero, _rectangle, MetafileFrameUnit.GdiCompatible));
627
new
Metafile
(fileName, IntPtr.Zero, _rectangle, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly));
629
new
Metafile
(fileName, IntPtr.Zero, _rectangle, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly, "description"));
641
AssertExtensions.Throws<ArgumentException>(null, () => new
Metafile
(fileName, referenceHdc, _rectangleF, frameUnit));
643
new
Metafile
(fileName, referenceHdc, _rectangleF, frameUnit, EmfType.EmfOnly));
645
new
Metafile
(fileName, referenceHdc, _rectangleF, frameUnit, EmfType.EmfOnly, "description"));
647
AssertExtensions.Throws<ArgumentException>(null, () => new
Metafile
(fileName, referenceHdc, _rectangle, frameUnit));
649
new
Metafile
(fileName, referenceHdc, _rectangle, frameUnit, EmfType.EmfOnly));
651
new
Metafile
(fileName, referenceHdc, _rectangle, frameUnit, EmfType.EmfOnly, "description"));
664
new
Metafile
(fileName, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, emfType));
666
new
Metafile
(fileName, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, emfType, "description"));
669
new
Metafile
(fileName, referenceHdc, _rectangle, MetafileFrameUnit.GdiCompatible, emfType));
671
new
Metafile
(fileName, referenceHdc, _rectangle, MetafileFrameUnit.GdiCompatible, emfType, "description"));
681
AssertExtensions.Throws<ArgumentNullException>("path", () => new
Metafile
((string)null, referenceHdc, _rectangleF));
683
new
Metafile
((string)null, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible));
685
new
Metafile
((string)null, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly));
687
new
Metafile
((string)null, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly, "description"));
698
AssertExtensions.Throws<ArgumentException, ArgumentException>("path", null, () => new
Metafile
(fileName, referenceHdc, _rectangleF));
700
new
Metafile
(fileName, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible));
702
new
Metafile
(fileName, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly));
704
new
Metafile
(fileName, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly, "description"));
714
Assert.Throws<PathTooLongException>(() => new
Metafile
(fileName, referenceHdc, _rectangleF));
716
new
Metafile
(fileName, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible));
718
new
Metafile
(fileName, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly));
720
new
Metafile
(fileName, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly, "description"));
730
using Metafile metafile =
new
(stream, g.GetHdc(), _rectangle);
741
using Metafile metafile =
new
(stream, g.GetHdc(), _rectangle, frameUnit);
752
using Metafile metafile =
new
(stream, g.GetHdc(), _rectangle, MetafileFrameUnit.GdiCompatible, emfType);
764
using Metafile metafile =
new
(
777
using Metafile metafile =
new
(
787
AssertExtensions.Throws<ArgumentException>(null, () => new
Metafile
(stream, IntPtr.Zero, _rectangle));
788
AssertExtensions.Throws<ArgumentException>(null, () => new
Metafile
(stream, IntPtr.Zero, _rectangle, MetafileFrameUnit.GdiCompatible));
790
new
Metafile
(stream, IntPtr.Zero, _rectangle, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly));
792
new
Metafile
(stream, IntPtr.Zero, _rectangle, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly, "description"));
803
AssertExtensions.Throws<ArgumentException>(null, () => new
Metafile
(stream, referenceHdc, _rectangle, frameUnit));
805
new
Metafile
(stream, referenceHdc, _rectangle, frameUnit, EmfType.EmfOnly));
807
new
Metafile
(stream, referenceHdc, _rectangle, frameUnit, EmfType.EmfOnly, "description"));
819
new
Metafile
(stream, referenceHdc, _rectangle, MetafileFrameUnit.GdiCompatible, emfType));
821
new
Metafile
(stream, referenceHdc, _rectangle, MetafileFrameUnit.GdiCompatible, emfType, "description"));
830
Assert.Throws<ArgumentNullException>(() => new
Metafile
((Stream)null, referenceHdc, _rectangleF));
831
Assert.Throws<ArgumentNullException>(() => new
Metafile
((Stream)null, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible));
833
new
Metafile
((Stream)null, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly));
835
new
Metafile
((Stream)null, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly, "description"));
849
using Metafile metafile =
new
(GetPath(WmfFile));
891
using Metafile metafile =
new
(GetPath(WmfFile));
901
Metafile metafile =
new
(GetPath(WmfFile));
910
using Metafile metafile =
new
(GetPath(WmfFile));
917
Metafile metafile =
new
(GetPath(WmfFile));
926
Metafile metafile =
new
(GetPath(WmfFile));
1033
Metafile metafile =
new
(henhmetafile: (nint)hemf.Value, deleteEmf: true);
System\Drawing\TextureBrushTests.cs (1)
14
yield return new object[] { new
Metafile
(Helpers.GetTestBitmapPath("telescope_01.wmf")), PixelFormat.Format32bppArgb, new Size(490, 654) };
System.Windows.Forms.Design (1)
System\Drawing\Design\MetafileEditor.cs (1)
18
protected override Image LoadFromStream(Stream stream) => new
Metafile
(stream);
System.Windows.Forms.Tests (29)
System\Windows\Forms\AxHostTests.cs (4)
1634
Metafile original =
new
("bitmaps/milkmateya01.emf");
1656
Metafile original =
new
("bitmaps/telescope_01.wmf");
1699
Metafile original =
new
("bitmaps/milkmateya01.emf");
1724
Metafile original =
new
("bitmaps/telescope_01.wmf");
System\Windows\Forms\ClipboardTests.cs (4)
392
using Metafile metafile =
new
("bitmaps/telescope_01.wmf");
393
using Metafile enhancedMetafile =
new
("bitmaps/milkmateya01.emf");
461
using Metafile metafile =
new
("bitmaps/telescope_01.wmf");
482
using Metafile metafile =
new
("bitmaps/milkmateya01.emf");
System\Windows\Forms\ControlPaintTests.cs (7)
1318
yield return new object[] { new
Metafile
("bitmaps/telescope_01.wmf"), -10, -20, Color.Red };
1319
yield return new object[] { new
Metafile
("bitmaps/telescope_01.wmf"), 0, 0, Color.Red };
1320
yield return new object[] { new
Metafile
("bitmaps/telescope_01.wmf"), 1, 2, Color.Red };
1321
yield return new object[] { new
Metafile
("bitmaps/telescope_01.wmf"), 0, 0, Color.Black };
1322
yield return new object[] { new
Metafile
("bitmaps/telescope_01.wmf"), 0, 0, Color.White };
1323
yield return new object[] { new
Metafile
("bitmaps/telescope_01.wmf"), 0, 0, Color.Transparent };
1324
yield return new object[] { new
Metafile
("bitmaps/telescope_01.wmf"), 0, 0, Color.Empty };
System\Windows\Forms\DataObjectTests.cs (1)
1930
using var metafile = new Drawing.Imaging.
Metafile
("bitmaps/milkmateya01.emf");
System\Windows\Forms\ImageList.ImageCollectionTests.cs (11)
341
using Metafile value =
new
("bitmaps/telescope_01.wmf");
808
using Metafile value =
new
("bitmaps/telescope_01.wmf");
885
using Metafile value =
new
("bitmaps/telescope_01.wmf");
1060
yield return new object[] { new
Metafile
("bitmaps/telescope_01.wmf") };
1274
yield return new object[] { new
Metafile
("bitmaps/telescope_01.wmf") };
1290
yield return new object[] { new
Metafile
("bitmaps/telescope_01.wmf") };
1725
using Metafile value =
new
("bitmaps/telescope_01.wmf");
1732
yield return new object[] { new
Metafile
("bitmaps/telescope_01.wmf") };
1763
yield return new object[] { new
Metafile
("bitmaps/telescope_01.wmf") };
1798
yield return new object[] { index, new
Metafile
("bitmaps/telescope_01.wmf") };
1815
yield return new object[] { new
Metafile
("bitmaps/telescope_01.wmf") };
System\Windows\Forms\TextRendererTests.cs (2)
755
using (Metafile metafileRecorder =
new
(stream, hdc.HDC, EmfType.EmfOnly))
779
using Metafile metafile =
new
(stream);
210 references to Metafile
PresentationFramework-SystemDrawing (4)
SystemDrawingExtension.cs (4)
27
internal override bool IsMetafile(object? data) => data is
Metafile
;
31
Metafile
metafile => metafile.GetHenhmetafile(),
61
Metafile
metafile = new(handle, deleteEmf: false);
91
Metafile
metafile = new(metafileStream);
System.Drawing (1)
System.Drawing.cs (1)
92
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.Imaging.
Metafile
))]
System.Drawing.Common (106)
System\Drawing\Graphics.cs (36)
2449
public void EnumerateMetafile(
Metafile
metafile, PointF destPoint, EnumerateMetafileProc callback) =>
2452
public void EnumerateMetafile(
Metafile
metafile, PointF destPoint, EnumerateMetafileProc callback, IntPtr callbackData) =>
2455
public void EnumerateMetafile(
Metafile
metafile, Point destPoint, EnumerateMetafileProc callback) =>
2458
public void EnumerateMetafile(
Metafile
metafile, Point destPoint, EnumerateMetafileProc callback, IntPtr callbackData) =>
2461
public void EnumerateMetafile(
Metafile
metafile, RectangleF destRect, EnumerateMetafileProc callback) =>
2464
public void EnumerateMetafile(
Metafile
metafile, RectangleF destRect, EnumerateMetafileProc callback, IntPtr callbackData) =>
2467
public void EnumerateMetafile(
Metafile
metafile, Rectangle destRect, EnumerateMetafileProc callback) =>
2470
public void EnumerateMetafile(
Metafile
metafile, Rectangle destRect, EnumerateMetafileProc callback, IntPtr callbackData) =>
2473
public void EnumerateMetafile(
Metafile
metafile, PointF[] destPoints, EnumerateMetafileProc callback) =>
2477
Metafile
metafile,
2482
public void EnumerateMetafile(
Metafile
metafile, Point[] destPoints, EnumerateMetafileProc callback) =>
2485
public void EnumerateMetafile(
Metafile
metafile, Point[] destPoints, EnumerateMetafileProc callback, IntPtr callbackData) =>
2489
Metafile
metafile,
2496
Metafile
metafile,
2504
Metafile
metafile,
2511
Metafile
metafile,
2519
Metafile
metafile,
2526
Metafile
metafile,
2534
Metafile
metafile,
2541
Metafile
metafile,
2549
Metafile
metafile,
2556
Metafile
metafile,
2564
Metafile
metafile,
2571
Metafile
metafile,
2940
Metafile
metafile,
2961
Metafile
metafile,
2969
Metafile
metafile,
2990
Metafile
metafile,
2997
Metafile
metafile,
3026
Metafile
metafile,
3055
Metafile
metafile,
3080
Metafile
metafile,
3096
Metafile
metafile,
3121
Metafile
metafile,
3130
Metafile
metafile,
3163
Metafile
metafile,
System\Drawing\Imaging\Metafile.cs (46)
27
/// Initializes a new instance of the <see cref='
Metafile
'/> class from the specified handle and
46
/// Initializes a new instance of the <see cref='
Metafile
'/> class from the specified handle and
57
/// Initializes a new instance of the <see cref='
Metafile
'/> class from the specified filename.
72
/// Initializes a new instance of the <see cref='
Metafile
'/> class from the specified device context, bounded
81
/// Initializes a new instance of the <see cref='
Metafile
'/> class from the specified handle to a device context.
89
/// Initializes a new instance of the <see cref='
Metafile
'/> class from the specified device context, bounded
98
/// Initializes a new instance of the <see cref='
Metafile
'/> class from the specified device context, bounded
107
/// Initializes a new instance of the <see cref='
Metafile
'/> class from the specified device context, bounded
116
/// Initializes a new instance of the <see cref='
Metafile
'/> class from the specified device context, bounded
139
/// Initializes a new instance of the <see cref='
Metafile
'/> class from the specified device context, bounded
148
/// Initializes a new instance of the <see cref='
Metafile
'/> class from the specified device context, bounded
157
/// Initializes a new instance of the <see cref='
Metafile
'/> class with the specified filename.
165
/// Initializes a new instance of the <see cref='
Metafile
'/> class with the specified filename.
173
/// Initializes a new instance of the <see cref='
Metafile
'/> class with the specified filename.
181
/// Initializes a new instance of the <see cref='
Metafile
'/> class with the specified filename.
189
/// Initializes a new instance of the <see cref='
Metafile
'/> class with the specified filename.
197
/// Initializes a new instance of the <see cref='
Metafile
'/> class with the specified filename.
205
/// Initializes a new instance of the <see cref='
Metafile
'/> class with the specified filename.
235
/// Initializes a new instance of the <see cref='
Metafile
'/> class with the specified filename.
243
/// Initializes a new instance of the <see cref='
Metafile
'/> class with the specified filename.
251
/// Initializes a new instance of the <see cref='
Metafile
'/> class with the specified filename.
259
/// Initializes a new instance of the <see cref='
Metafile
'/> class with the specified filename.
267
/// Initializes a new instance of the <see cref='
Metafile
'/> class from the specified data stream.
275
/// Initializes a new instance of the <see cref='
Metafile
'/> class from the specified data stream.
283
/// Initializes a new instance of the <see cref='
Metafile
'/> class from the specified data stream.
291
/// Initializes a new instance of the <see cref='
Metafile
'/> class with the specified filename.
299
/// Initializes a new instance of the <see cref='
Metafile
'/> class with the specified filename.
307
/// Initializes a new instance of the <see cref='
Metafile
'/> class from the specified data stream.
315
/// Initializes a new instance of the <see cref='
Metafile
'/> class with the specified filename.
323
/// Initializes a new instance of the <see cref='
Metafile
'/> class with the specified filename.
331
/// Initializes a new instance of the <see cref='
Metafile
'/> class from the specified handle and
340
/// Initializes a new instance of the <see cref='
Metafile
'/> class from the specified stream.
353
/// Initializes a new instance of the <see cref='
Metafile
'/> class from the specified handle to a device context.
373
/// Initializes a new instance of the <see cref='
Metafile
'/> class from the specified device context, bounded
397
/// Initializes a new instance of the <see cref='
Metafile
'/> class with the specified filename.
422
/// Initializes a new instance of the <see cref='
Metafile
'/> class with the specified filename.
448
/// Initializes a new instance of the <see cref='
Metafile
'/> class from the specified data stream.
472
/// Initializes a new instance of the <see cref='
Metafile
'/> class with the specified filename.
497
/// Initializes a new instance of the <see cref='
Metafile
'/> class with the specified filename.
526
/// Initializes a new instance of the <see cref="
Metafile
"/> class from a native metafile handle.
553
/// Returns the <see cref='MetafileHeader'/> associated with the specified <see cref='
Metafile
'/>.
568
/// Returns the <see cref='MetafileHeader'/> associated with the specified <see cref='
Metafile
'/>.
581
/// Returns the <see cref='MetafileHeader'/> associated with the specified <see cref='
Metafile
'/>.
599
/// Returns the <see cref='MetafileHeader'/> associated with the specified <see cref='
Metafile
'/>.
616
/// Returns the <see cref='MetafileHeader'/> associated with this <see cref='
Metafile
'/>.
631
/// Returns a Windows handle to an enhanced <see cref='
Metafile
'/>.
System\Drawing\Imaging\MetafileFrameUnit.cs (1)
8
/// This is specified during the creation of the <see cref='
Metafile
'/>.
System\Drawing\Imaging\MetafileHeader.cs (18)
9
/// Contains attributes of an associated <see cref='
Metafile
'/>.
21
/// Gets the type of the associated <see cref='
Metafile
'/>.
26
/// Gets the size, in bytes, of the associated <see cref='
Metafile
'/>.
31
/// Gets the version number of the associated <see cref='
Metafile
'/>.
36
/// Gets the horizontal resolution, in dots-per-inch, of the associated <see cref='
Metafile
'/>.
41
/// Gets the vertical resolution, in dots-per-inch, of the associated <see cref='
Metafile
'/>.
46
/// Gets a <see cref='Rectangle'/> that bounds the associated <see cref='
Metafile
'/>.
51
/// Returns a value indicating whether the associated <see cref='
Metafile
'/> is in the Windows metafile format.
56
/// Returns a value indicating whether the associated <see cref='
Metafile
'/> is in the Windows Placeable metafile format.
61
/// Returns a value indicating whether the associated <see cref='
Metafile
'/> is in the Windows enhanced metafile format.
66
/// Returns a value indicating whether the associated <see cref='
Metafile
'/> is in the Windows enhanced
74
/// Returns a value indicating whether the associated <see cref='
Metafile
'/> is in the Windows enhanced
81
/// Returns a value indicating whether the associated <see cref='
Metafile
'/> is in the Dual enhanced metafile
87
/// Returns a value indicating whether the associated <see cref='
Metafile
'/> supports only the Windows
93
/// Returns a value indicating whether the associated <see cref='
Metafile
'/> is device-dependent.
98
/// Gets the WMF header file for the associated <see cref='
Metafile
'/>.
110
/// Gets the logical horizontal resolution, in dots-per-inch, of the associated <see cref='
Metafile
'/>.
115
/// Gets the logical vertical resolution, in dots-per-inch, of the associated <see cref='
Metafile
'/>.
System\Drawing\Imaging\MetafileType.cs (1)
7
/// Specifies the format of a <see cref='
Metafile
'/>.
System\Drawing\Imaging\MetaHeader.cs (2)
24
/// Represents the type of the associated <see cref='
Metafile
'/>.
51
/// Represents the size, in bytes, of the associated <see cref='
Metafile
'/>.
System\Drawing\PointerExtensions.cs (1)
28
public static GpMetafile* Pointer(this
Metafile
? metafile) => metafile is null ? null : (GpMetafile*)((Image)metafile).Pointer();
System\Drawing\Printing\PreviewPrintController.cs (1)
65
Metafile
metafile = new(
System.Drawing.Common.Tests (72)
mono\System.Imaging\MetafileTest.cs (15)
46
using
Metafile
mf = new(filename);
47
using
Metafile
clone = (
Metafile
)mf.Clone();
94
using
Metafile
mf = new(Helpers.GetTestBitmapPath(WmfPlaceable));
109
using
Metafile
mf = new(fs);
125
using
Metafile
mf = new(ms);
161
using
Metafile
mf = new(Helpers.GetTestBitmapPath(Emf));
170
using
Metafile
mf = new(fs);
180
using
Metafile
mf = new(ms);
188
private static void CheckEmptyHeader(
Metafile
mf, EmfType type)
221
Metafile
mf = new(hdc, default(Rectangle));
238
Metafile
mf = new(hdc, default(RectangleF));
254
Metafile
mf = new(stream, hdc, type);
288
Metafile
mf;
330
Metafile
mf;
System\Drawing\GraphicsTests.cs (1)
285
using
Metafile
image = new(Helpers.GetTestBitmapPath("telescope_01.wmf"));
System\Drawing\IconConverterTests.cs (4)
48
Assert.False(_icoConv.CanConvertFrom(null, typeof(
Metafile
)), "Metafile");
61
Assert.False(_icoConvFrmTD.CanConvertFrom(null, typeof(
Metafile
)), "TD Metafile");
148
Assert.Throws<NotSupportedException>(() => _icoConv.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(
Metafile
)));
165
Assert.Throws<NotSupportedException>(() => _icoConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(
Metafile
)));
System\Drawing\ImageConverterTests.cs (4)
74
Assert.False(_imgConv.CanConvertFrom(null, typeof(
Metafile
)), "Mefafile");
87
Assert.False(_imgConvFrmTD.CanConvertFrom(null, typeof(
Metafile
)), "TD Metafile");
202
Assert.Throws<NotSupportedException>(() => _imgConv.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(
Metafile
)));
211
Assert.Throws<NotSupportedException>(() => _imgConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(
Metafile
)));
System\Drawing\Imaging\MetafileTests.cs (48)
49
using
Metafile
metafile = new(GetPath(WmfFile));
56
using
Metafile
metafile = new(GetPath(WmfFile));
97
using
Metafile
metafile = new(stream);
127
using
Metafile
metafile = new(g.GetHdc(), emfType);
173
using
Metafile
metafile = new(g.GetHdc(), EmfType.EmfOnly, description);
189
using
Metafile
metafile = new(g.GetHdc(), _rectangleF);
209
using
Metafile
metafile = new(g.GetHdc(), _rectangleF, frameUnit);
219
using
Metafile
metafile = new(g.GetHdc(), _rectangleF, MetafileFrameUnit.Pixel, emfType);
230
using
Metafile
metafile = new(g.GetHdc(), _rectangleF, MetafileFrameUnit.Pixel, EmfType.EmfOnly, description);
239
using
Metafile
metafile = new(g.GetHdc(), _rectangle);
249
using
Metafile
metafile = new(g.GetHdc(), _rectangle, frameUnit);
259
using
Metafile
metafile = new(g.GetHdc(), _rectangle, MetafileFrameUnit.Pixel, emfType);
270
using
Metafile
metafile = new(g.GetHdc(), _rectangle, MetafileFrameUnit.Pixel, EmfType.EmfOnly, description);
342
using (
Metafile
metafile = new(fileName, g.GetHdc()))
358
using (
Metafile
metafile = new(fileName, g.GetHdc(), emfType))
375
using (
Metafile
metafile = new(fileName, g.GetHdc(), EmfType.EmfPlusDual, description))
451
using (
Metafile
metafile = new(fileName, g.GetHdc(), _rectangleF))
467
using (
Metafile
metafile = new(fileName, g.GetHdc(), _rectangleF, frameUnit))
483
using (
Metafile
metafile = new(fileName, g.GetHdc(), _rectangleF, MetafileFrameUnit.GdiCompatible, emfType))
500
using (
Metafile
metafile = new(
518
using (
Metafile
metafile = new(
535
using (
Metafile
metafile = new(fileName, g.GetHdc(), _rectangle))
551
using (
Metafile
metafile = new(fileName, g.GetHdc(), _rectangle, frameUnit))
567
using (
Metafile
metafile = new(fileName, g.GetHdc(), _rectangle, MetafileFrameUnit.GdiCompatible, emfType))
584
using (
Metafile
metafile = new(
602
using (
Metafile
metafile = new(
730
using
Metafile
metafile = new(stream, g.GetHdc(), _rectangle);
741
using
Metafile
metafile = new(stream, g.GetHdc(), _rectangle, frameUnit);
752
using
Metafile
metafile = new(stream, g.GetHdc(), _rectangle, MetafileFrameUnit.GdiCompatible, emfType);
764
using
Metafile
metafile = new(
777
using
Metafile
metafile = new(
841
MetafileHeader header =
Metafile
.GetMetafileHeader(GetPath(WmfFile));
848
AssertExtensions.Throws<ArgumentException>(null, () =>
Metafile
.GetMetafileHeader(IntPtr.Zero));
849
using
Metafile
metafile = new(GetPath(WmfFile));
850
AssertExtensions.Throws<ArgumentException>(null, () =>
Metafile
.GetMetafileHeader(metafile.GetHenhmetafile()));
858
AssertExtensions.Throws<ArgumentException>("path", null, () =>
Metafile
.GetMetafileHeader(fileName));
864
AssertExtensions.Throws<ArgumentNullException>("path", () =>
Metafile
.GetMetafileHeader((string)null));
871
MetafileHeader header =
Metafile
.GetMetafileHeader(stream);
878
Assert.Throws<ArgumentNullException>(() =>
Metafile
.GetMetafileHeader((Stream)null));
885
AssertExtensions.Throws<ArgumentException>(null, () =>
Metafile
.GetMetafileHeader(stream));
891
using
Metafile
metafile = new(GetPath(WmfFile));
901
Metafile
metafile = new(GetPath(WmfFile));
910
using
Metafile
metafile = new(GetPath(WmfFile));
917
Metafile
metafile = new(GetPath(WmfFile));
926
Metafile
metafile = new(GetPath(WmfFile));
962
private void AssertMetafileIsBlank(
Metafile
metafile)
982
private void AssertMetafile(
Metafile
metafile)
1033
Metafile
metafile = new(henhmetafile: (nint)hemf.Value, deleteEmf: true);
System.Windows.Forms (3)
System\Drawing\Design\UITypeEditor.cs (1)
59
[typeof(
Metafile
)] = $"System.Drawing.Design.MetafileEditor, {Assemblies.SystemDrawingDesign}",
System\Windows\Forms\Control.cs (1)
4838
/// or <see cref="Drawing.Imaging.
Metafile
"/>) or some <see cref="object"/> that implements
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (1)
2137
/// either be a base managed class (<see cref="string"/>, <see cref="Bitmap"/>, or <see cref="
Metafile
"/>)
System.Windows.Forms.Design.Tests (3)
EnsureEditorsTests.cs (1)
55
[InlineData(typeof(
Metafile
), typeof(MetafileEditor))]
System\Drawing\Design\MetafileEditorTests.cs (2)
70
Metafile
result = Assert.IsType<
Metafile
>(editor.LoadFromStream(stream));
System.Windows.Forms.Primitives (2)
System\Drawing\ImageExtensions.cs (2)
35
using (
Metafile
metafile = new((HMETAFILE)handle, header, deleteWmf: false))
41
using (
Metafile
metafile = new((HENHMETAFILE)handle, deleteEmf: false))
System.Windows.Forms.Tests (19)
System\Windows\Forms\AxHostTests.cs (8)
1634
Metafile
original = new("bitmaps/milkmateya01.emf");
1649
var
result = Assert.IsType<
Metafile
>(SubAxHost.GetPictureFromIPictureDisp(disp));
1656
Metafile
original = new("bitmaps/telescope_01.wmf");
1699
Metafile
original = new("bitmaps/milkmateya01.emf");
1717
var
result = Assert.IsType<
Metafile
>(SubAxHost.GetPictureFromIPicture(iPicture));
1724
Metafile
original = new("bitmaps/telescope_01.wmf");
System\Windows\Forms\ClipboardTests.cs (4)
392
using
Metafile
metafile = new("bitmaps/telescope_01.wmf");
393
using
Metafile
enhancedMetafile = new("bitmaps/milkmateya01.emf");
461
using
Metafile
metafile = new("bitmaps/telescope_01.wmf");
482
using
Metafile
metafile = new("bitmaps/milkmateya01.emf");
System\Windows\Forms\DataObjectTests.cs (1)
1930
using
var
metafile = new Drawing.Imaging.Metafile("bitmaps/milkmateya01.emf");
System\Windows\Forms\ImageList.ImageCollectionTests.cs (4)
341
using
Metafile
value = new("bitmaps/telescope_01.wmf");
808
using
Metafile
value = new("bitmaps/telescope_01.wmf");
885
using
Metafile
value = new("bitmaps/telescope_01.wmf");
1725
using
Metafile
value = new("bitmaps/telescope_01.wmf");
System\Windows\Forms\TextRendererTests.cs (2)
755
using (
Metafile
metafileRecorder = new(stream, hdc.HDC, EmfType.EmfOnly))
779
using
Metafile
metafile = new(stream);