172 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.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)
286
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)
15
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)
295
using Metafile metafile =
new
("bitmaps/telescope_01.wmf");
296
using Metafile enhancedMetafile =
new
("bitmaps/milkmateya01.emf");
364
using Metafile metafile =
new
("bitmaps/telescope_01.wmf");
385
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);
140 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 (36)
Special\NotSupported.cs (36)
549
public void EnumerateMetafile(System.Drawing.Imaging.
Metafile
metafile, System.Drawing.Point destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
550
public void EnumerateMetafile(System.Drawing.Imaging.
Metafile
metafile, System.Drawing.Point destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
551
public void EnumerateMetafile(System.Drawing.Imaging.
Metafile
metafile, System.Drawing.Point destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData, System.Drawing.Imaging.ImageAttributes? imageAttr) { 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); }
555
public void EnumerateMetafile(System.Drawing.Imaging.
Metafile
metafile, System.Drawing.PointF destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
556
public void EnumerateMetafile(System.Drawing.Imaging.
Metafile
metafile, System.Drawing.PointF destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
557
public void EnumerateMetafile(System.Drawing.Imaging.
Metafile
metafile, System.Drawing.PointF destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData, System.Drawing.Imaging.ImageAttributes? imageAttr) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
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); }
561
public void EnumerateMetafile(System.Drawing.Imaging.
Metafile
metafile, System.Drawing.PointF[] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
562
public void EnumerateMetafile(System.Drawing.Imaging.
Metafile
metafile, System.Drawing.PointF[] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
563
public void EnumerateMetafile(System.Drawing.Imaging.
Metafile
metafile, System.Drawing.PointF[] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData, System.Drawing.Imaging.ImageAttributes? imageAttr) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
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); }
567
public void EnumerateMetafile(System.Drawing.Imaging.
Metafile
metafile, System.Drawing.Point[] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
568
public void EnumerateMetafile(System.Drawing.Imaging.
Metafile
metafile, System.Drawing.Point[] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
569
public void EnumerateMetafile(System.Drawing.Imaging.
Metafile
metafile, System.Drawing.Point[] destPoints, 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); }
573
public void EnumerateMetafile(System.Drawing.Imaging.
Metafile
metafile, System.Drawing.Rectangle destRect, System.Drawing.Graphics.EnumerateMetafileProc callback) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
574
public void EnumerateMetafile(System.Drawing.Imaging.
Metafile
metafile, System.Drawing.Rectangle destRect, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
575
public void EnumerateMetafile(System.Drawing.Imaging.
Metafile
metafile, System.Drawing.Rectangle destRect, 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); }
579
public void EnumerateMetafile(System.Drawing.Imaging.
Metafile
metafile, System.Drawing.RectangleF destRect, System.Drawing.Graphics.EnumerateMetafileProc callback) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
580
public void EnumerateMetafile(System.Drawing.Imaging.
Metafile
metafile, System.Drawing.RectangleF destRect, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
581
public void EnumerateMetafile(System.Drawing.Imaging.
Metafile
metafile, System.Drawing.RectangleF destRect, 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); }
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)
286
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)
295
using
Metafile
metafile = new("bitmaps/telescope_01.wmf");
296
using
Metafile
enhancedMetafile = new("bitmaps/milkmateya01.emf");
364
using
Metafile
metafile = new("bitmaps/telescope_01.wmf");
385
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);