172 instantiations of Metafile
PresentationFramework-SystemDrawing (3)
SystemDrawingExtension.cs (3)
35internal override object GetMetafileFromHemf(nint hMetafile) => new Metafile(hMetafile, deleteEmf: false); 61Metafile metafile = new(handle, deleteEmf: false); 91Metafile metafile = new(metafileStream);
System.Drawing.Common.Tests (139)
mono\System.Imaging\MetafileTest.cs (12)
46using Metafile mf = new(filename); 94using Metafile mf = new(Helpers.GetTestBitmapPath(WmfPlaceable)); 109using Metafile mf = new(fs); 125using Metafile mf = new(ms); 161using Metafile mf = new(Helpers.GetTestBitmapPath(Emf)); 170using Metafile mf = new(fs); 180using Metafile mf = new(ms); 221Metafile mf = new(hdc, default(Rectangle)); 238Metafile mf = new(hdc, default(RectangleF)); 254Metafile mf = new(stream, hdc, type); 295mf = new Metafile(hdc, EmfType.EmfPlusOnly); 337mf = new Metafile(hdc, EmfType.EmfPlusOnly);
System\Drawing\GraphicsTests.cs (1)
286using Metafile image = new(Helpers.GetTestBitmapPath("telescope_01.wmf"));
System\Drawing\Imaging\MetafileTests.cs (125)
43AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(IntPtr.Zero, false)); 49using Metafile metafile = new(GetPath(WmfFile)); 50Assert.Throws<ExternalException>(() => new Metafile(metafile.GetHenhmetafile(), false)); 56using Metafile metafile = new(GetPath(WmfFile)); 63Assert.Throws<ExternalException>(() => new Metafile(GetPath(BmpFile))); 69AssertExtensions.Throws<ArgumentNullException>("path", () => new Metafile((string)null)); 75Assert.Throws<ExternalException>(() => new Metafile("fileNotExist")); 90AssertExtensions.Throws<ArgumentException>("path", null, () => new Metafile(path)); 97using Metafile metafile = new(stream); 104AssertExtensions.Throws<ArgumentNullException, ArgumentException>("stream", null, () => new Metafile((Stream)null)); 111Assert.Throws<ExternalException>(() => new Metafile(stream)); 127using Metafile metafile = new(g.GetHdc(), emfType); 146AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(g.GetHdc(), emfType)); 152AssertExtensions.Throws<ArgumentException>(null, () => new Metafile((IntPtr)null, EmfType.EmfOnly)); 158AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(IntPtr.Zero, EmfType.EmfOnly)); 173using Metafile metafile = new(g.GetHdc(), EmfType.EmfOnly, description); 181AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(IntPtr.Zero, EmfType.EmfOnly, description)); 189using Metafile metafile = new(g.GetHdc(), _rectangleF); 209using Metafile metafile = new(g.GetHdc(), _rectangleF, frameUnit); 219using Metafile metafile = new(g.GetHdc(), _rectangleF, MetafileFrameUnit.Pixel, emfType); 230using Metafile metafile = new(g.GetHdc(), _rectangleF, MetafileFrameUnit.Pixel, EmfType.EmfOnly, description); 239using Metafile metafile = new(g.GetHdc(), _rectangle); 249using Metafile metafile = new(g.GetHdc(), _rectangle, frameUnit); 259using Metafile metafile = new(g.GetHdc(), _rectangle, MetafileFrameUnit.Pixel, emfType); 270using Metafile metafile = new(g.GetHdc(), _rectangle, MetafileFrameUnit.Pixel, EmfType.EmfOnly, description); 277AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(IntPtr.Zero, _rectangleF)); 278AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(IntPtr.Zero, _rectangleF, MetafileFrameUnit.Pixel)); 280new Metafile(IntPtr.Zero, _rectangleF, MetafileFrameUnit.Pixel, EmfType.EmfOnly)); 282new Metafile(IntPtr.Zero, _rectangleF, MetafileFrameUnit.Pixel, EmfType.EmfOnly, "description")); 284AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(IntPtr.Zero, _rectangle)); 285AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(IntPtr.Zero, _rectangle, MetafileFrameUnit.Pixel)); 287new Metafile(IntPtr.Zero, _rectangle, MetafileFrameUnit.Pixel, EmfType.EmfOnly)); 289new Metafile(IntPtr.Zero, _rectangle, MetafileFrameUnit.Pixel, EmfType.EmfOnly, "description")); 307AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(referenceHdc, _rectangleF, farameUnit)); 308AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(referenceHdc, _rectangleF, farameUnit, EmfType.EmfOnly)); 310new Metafile(referenceHdc, _rectangleF, farameUnit, EmfType.EmfOnly, "description")); 312AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(referenceHdc, _rectangle, farameUnit)); 313AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(referenceHdc, _rectangle, farameUnit, EmfType.EmfOnly)); 315new Metafile(referenceHdc, _rectangle, farameUnit, EmfType.EmfOnly, "description")); 326new Metafile(referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, emfType)); 328new Metafile(referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, emfType, "description")); 331new Metafile(referenceHdc, _rectangle, MetafileFrameUnit.GdiCompatible, emfType)); 333new Metafile(referenceHdc, _rectangle, MetafileFrameUnit.GdiCompatible, emfType, "description")); 342using (Metafile metafile = new(fileName, g.GetHdc())) 358using (Metafile metafile = new(fileName, g.GetHdc(), emfType)) 375using (Metafile metafile = new(fileName, g.GetHdc(), EmfType.EmfPlusDual, description)) 389AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, IntPtr.Zero)); 390AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, IntPtr.Zero, EmfType.EmfOnly)); 391AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, IntPtr.Zero, EmfType.EmfOnly, "description")); 403AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, referenceHdc, emfType)); 404AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, referenceHdc, emfType, "description")); 414AssertExtensions.Throws<ArgumentNullException>("path", () => new Metafile((string)null, referenceHdc)); 415AssertExtensions.Throws<ArgumentNullException>("path", () => new Metafile((string)null, referenceHdc, EmfType.EmfOnly)); 416AssertExtensions.Throws<ArgumentNullException>("path", () => new Metafile((string)null, referenceHdc, EmfType.EmfOnly, "description")); 427AssertExtensions.Throws<ArgumentException>("path", null, () => new Metafile(fileName, referenceHdc)); 428AssertExtensions.Throws<ArgumentException>("path", null, () => new Metafile(fileName, referenceHdc, EmfType.EmfOnly)); 429AssertExtensions.Throws<ArgumentException>("path", null, () => new Metafile(fileName, referenceHdc, EmfType.EmfOnly, "description")); 439Assert.Throws<PathTooLongException>(() => new Metafile(fileName, referenceHdc)); 440Assert.Throws<PathTooLongException>(() => new Metafile(fileName, referenceHdc, EmfType.EmfOnly)); 441Assert.Throws<PathTooLongException>(() => new Metafile(fileName, referenceHdc, EmfType.EmfOnly, "description")); 451using (Metafile metafile = new(fileName, g.GetHdc(), _rectangleF)) 467using (Metafile metafile = new(fileName, g.GetHdc(), _rectangleF, frameUnit)) 483using (Metafile metafile = new(fileName, g.GetHdc(), _rectangleF, MetafileFrameUnit.GdiCompatible, emfType)) 500using (Metafile metafile = new( 518using (Metafile metafile = new( 535using (Metafile metafile = new(fileName, g.GetHdc(), _rectangle)) 551using (Metafile metafile = new(fileName, g.GetHdc(), _rectangle, frameUnit)) 567using (Metafile metafile = new(fileName, g.GetHdc(), _rectangle, MetafileFrameUnit.GdiCompatible, emfType)) 584using (Metafile metafile = new( 602using (Metafile metafile = new( 617AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, IntPtr.Zero, _rectangleF)); 618AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, IntPtr.Zero, _rectangleF, MetafileFrameUnit.GdiCompatible)); 620new Metafile(fileName, IntPtr.Zero, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly)); 622new Metafile(fileName, IntPtr.Zero, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly, "description")); 624AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, IntPtr.Zero, _rectangle)); 625AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, IntPtr.Zero, _rectangle, MetafileFrameUnit.GdiCompatible)); 627new Metafile(fileName, IntPtr.Zero, _rectangle, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly)); 629new Metafile(fileName, IntPtr.Zero, _rectangle, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly, "description")); 641AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, referenceHdc, _rectangleF, frameUnit)); 643new Metafile(fileName, referenceHdc, _rectangleF, frameUnit, EmfType.EmfOnly)); 645new Metafile(fileName, referenceHdc, _rectangleF, frameUnit, EmfType.EmfOnly, "description")); 647AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, referenceHdc, _rectangle, frameUnit)); 649new Metafile(fileName, referenceHdc, _rectangle, frameUnit, EmfType.EmfOnly)); 651new Metafile(fileName, referenceHdc, _rectangle, frameUnit, EmfType.EmfOnly, "description")); 664new Metafile(fileName, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, emfType)); 666new Metafile(fileName, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, emfType, "description")); 669new Metafile(fileName, referenceHdc, _rectangle, MetafileFrameUnit.GdiCompatible, emfType)); 671new Metafile(fileName, referenceHdc, _rectangle, MetafileFrameUnit.GdiCompatible, emfType, "description")); 681AssertExtensions.Throws<ArgumentNullException>("path", () => new Metafile((string)null, referenceHdc, _rectangleF)); 683new Metafile((string)null, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible)); 685new Metafile((string)null, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly)); 687new Metafile((string)null, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly, "description")); 698AssertExtensions.Throws<ArgumentException, ArgumentException>("path", null, () => new Metafile(fileName, referenceHdc, _rectangleF)); 700new Metafile(fileName, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible)); 702new Metafile(fileName, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly)); 704new Metafile(fileName, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly, "description")); 714Assert.Throws<PathTooLongException>(() => new Metafile(fileName, referenceHdc, _rectangleF)); 716new Metafile(fileName, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible)); 718new Metafile(fileName, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly)); 720new Metafile(fileName, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly, "description")); 730using Metafile metafile = new(stream, g.GetHdc(), _rectangle); 741using Metafile metafile = new(stream, g.GetHdc(), _rectangle, frameUnit); 752using Metafile metafile = new(stream, g.GetHdc(), _rectangle, MetafileFrameUnit.GdiCompatible, emfType); 764using Metafile metafile = new( 777using Metafile metafile = new( 787AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(stream, IntPtr.Zero, _rectangle)); 788AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(stream, IntPtr.Zero, _rectangle, MetafileFrameUnit.GdiCompatible)); 790new Metafile(stream, IntPtr.Zero, _rectangle, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly)); 792new Metafile(stream, IntPtr.Zero, _rectangle, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly, "description")); 803AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(stream, referenceHdc, _rectangle, frameUnit)); 805new Metafile(stream, referenceHdc, _rectangle, frameUnit, EmfType.EmfOnly)); 807new Metafile(stream, referenceHdc, _rectangle, frameUnit, EmfType.EmfOnly, "description")); 819new Metafile(stream, referenceHdc, _rectangle, MetafileFrameUnit.GdiCompatible, emfType)); 821new Metafile(stream, referenceHdc, _rectangle, MetafileFrameUnit.GdiCompatible, emfType, "description")); 830Assert.Throws<ArgumentNullException>(() => new Metafile((Stream)null, referenceHdc, _rectangleF)); 831Assert.Throws<ArgumentNullException>(() => new Metafile((Stream)null, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible)); 833new Metafile((Stream)null, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly)); 835new Metafile((Stream)null, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly, "description")); 849using Metafile metafile = new(GetPath(WmfFile)); 891using Metafile metafile = new(GetPath(WmfFile)); 901Metafile metafile = new(GetPath(WmfFile)); 910using Metafile metafile = new(GetPath(WmfFile)); 917Metafile metafile = new(GetPath(WmfFile)); 926Metafile metafile = new(GetPath(WmfFile)); 1033Metafile metafile = new(henhmetafile: (nint)hemf.Value, deleteEmf: true);
System\Drawing\TextureBrushTests.cs (1)
15yield 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)
18protected override Image LoadFromStream(Stream stream) => new Metafile(stream);
System.Windows.Forms.Tests (29)
System\Windows\Forms\AxHostTests.cs (4)
1634Metafile original = new("bitmaps/milkmateya01.emf"); 1656Metafile original = new("bitmaps/telescope_01.wmf"); 1699Metafile original = new("bitmaps/milkmateya01.emf"); 1724Metafile original = new("bitmaps/telescope_01.wmf");
System\Windows\Forms\ClipboardTests.cs (4)
295using Metafile metafile = new("bitmaps/telescope_01.wmf"); 296using Metafile enhancedMetafile = new("bitmaps/milkmateya01.emf"); 364using Metafile metafile = new("bitmaps/telescope_01.wmf"); 385using Metafile metafile = new("bitmaps/milkmateya01.emf");
System\Windows\Forms\ControlPaintTests.cs (7)
1318yield return new object[] { new Metafile("bitmaps/telescope_01.wmf"), -10, -20, Color.Red }; 1319yield return new object[] { new Metafile("bitmaps/telescope_01.wmf"), 0, 0, Color.Red }; 1320yield return new object[] { new Metafile("bitmaps/telescope_01.wmf"), 1, 2, Color.Red }; 1321yield return new object[] { new Metafile("bitmaps/telescope_01.wmf"), 0, 0, Color.Black }; 1322yield return new object[] { new Metafile("bitmaps/telescope_01.wmf"), 0, 0, Color.White }; 1323yield return new object[] { new Metafile("bitmaps/telescope_01.wmf"), 0, 0, Color.Transparent }; 1324yield return new object[] { new Metafile("bitmaps/telescope_01.wmf"), 0, 0, Color.Empty };
System\Windows\Forms\DataObjectTests.cs (1)
1930using var metafile = new Drawing.Imaging.Metafile("bitmaps/milkmateya01.emf");
System\Windows\Forms\ImageList.ImageCollectionTests.cs (11)
341using Metafile value = new("bitmaps/telescope_01.wmf"); 808using Metafile value = new("bitmaps/telescope_01.wmf"); 885using Metafile value = new("bitmaps/telescope_01.wmf"); 1060yield return new object[] { new Metafile("bitmaps/telescope_01.wmf") }; 1274yield return new object[] { new Metafile("bitmaps/telescope_01.wmf") }; 1290yield return new object[] { new Metafile("bitmaps/telescope_01.wmf") }; 1725using Metafile value = new("bitmaps/telescope_01.wmf"); 1732yield return new object[] { new Metafile("bitmaps/telescope_01.wmf") }; 1763yield return new object[] { new Metafile("bitmaps/telescope_01.wmf") }; 1798yield return new object[] { index, new Metafile("bitmaps/telescope_01.wmf") }; 1815yield return new object[] { new Metafile("bitmaps/telescope_01.wmf") };
System\Windows\Forms\TextRendererTests.cs (2)
755using (Metafile metafileRecorder = new(stream, hdc.HDC, EmfType.EmfOnly)) 779using Metafile metafile = new(stream);
140 references to Metafile
PresentationFramework-SystemDrawing (4)
SystemDrawingExtension.cs (4)
27internal override bool IsMetafile(object? data) => data is Metafile; 31Metafile metafile => metafile.GetHenhmetafile(), 61Metafile metafile = new(handle, deleteEmf: false); 91Metafile 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)
549public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Point destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 550public 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); } 551public 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); } 552public 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); } 553public 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); } 554public 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); } 555public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 556public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 557public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData, System.Drawing.Imaging.ImageAttributes? imageAttr) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 558public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF destPoint, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 559public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF destPoint, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 560public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF destPoint, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit unit, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData, System.Drawing.Imaging.ImageAttributes? imageAttr) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 561public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF[] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 562public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF[] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 563public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF[] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData, System.Drawing.Imaging.ImageAttributes? imageAttr) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 564public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 565public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 566public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit unit, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData, System.Drawing.Imaging.ImageAttributes? imageAttr) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 567public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Point[] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 568public 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); } 569public 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); } 570public 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); } 571public 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); } 572public 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); } 573public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Rectangle destRect, System.Drawing.Graphics.EnumerateMetafileProc callback) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 574public 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); } 575public 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); } 576public 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); } 577public 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); } 578public 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); } 579public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.RectangleF destRect, System.Drawing.Graphics.EnumerateMetafileProc callback) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 580public 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); } 581public 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); } 582public 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); } 583public 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); } 584public 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)
46using Metafile mf = new(filename); 47using Metafile clone = (Metafile)mf.Clone(); 94using Metafile mf = new(Helpers.GetTestBitmapPath(WmfPlaceable)); 109using Metafile mf = new(fs); 125using Metafile mf = new(ms); 161using Metafile mf = new(Helpers.GetTestBitmapPath(Emf)); 170using Metafile mf = new(fs); 180using Metafile mf = new(ms); 188private static void CheckEmptyHeader(Metafile mf, EmfType type) 221Metafile mf = new(hdc, default(Rectangle)); 238Metafile mf = new(hdc, default(RectangleF)); 254Metafile mf = new(stream, hdc, type); 288Metafile mf; 330Metafile mf;
System\Drawing\GraphicsTests.cs (1)
286using Metafile image = new(Helpers.GetTestBitmapPath("telescope_01.wmf"));
System\Drawing\IconConverterTests.cs (4)
48Assert.False(_icoConv.CanConvertFrom(null, typeof(Metafile)), "Metafile"); 61Assert.False(_icoConvFrmTD.CanConvertFrom(null, typeof(Metafile)), "TD Metafile"); 148Assert.Throws<NotSupportedException>(() => _icoConv.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(Metafile))); 165Assert.Throws<NotSupportedException>(() => _icoConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(Metafile)));
System\Drawing\ImageConverterTests.cs (4)
74Assert.False(_imgConv.CanConvertFrom(null, typeof(Metafile)), "Mefafile"); 87Assert.False(_imgConvFrmTD.CanConvertFrom(null, typeof(Metafile)), "TD Metafile"); 202Assert.Throws<NotSupportedException>(() => _imgConv.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(Metafile))); 211Assert.Throws<NotSupportedException>(() => _imgConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(Metafile)));
System\Drawing\Imaging\MetafileTests.cs (48)
49using Metafile metafile = new(GetPath(WmfFile)); 56using Metafile metafile = new(GetPath(WmfFile)); 97using Metafile metafile = new(stream); 127using Metafile metafile = new(g.GetHdc(), emfType); 173using Metafile metafile = new(g.GetHdc(), EmfType.EmfOnly, description); 189using Metafile metafile = new(g.GetHdc(), _rectangleF); 209using Metafile metafile = new(g.GetHdc(), _rectangleF, frameUnit); 219using Metafile metafile = new(g.GetHdc(), _rectangleF, MetafileFrameUnit.Pixel, emfType); 230using Metafile metafile = new(g.GetHdc(), _rectangleF, MetafileFrameUnit.Pixel, EmfType.EmfOnly, description); 239using Metafile metafile = new(g.GetHdc(), _rectangle); 249using Metafile metafile = new(g.GetHdc(), _rectangle, frameUnit); 259using Metafile metafile = new(g.GetHdc(), _rectangle, MetafileFrameUnit.Pixel, emfType); 270using Metafile metafile = new(g.GetHdc(), _rectangle, MetafileFrameUnit.Pixel, EmfType.EmfOnly, description); 342using (Metafile metafile = new(fileName, g.GetHdc())) 358using (Metafile metafile = new(fileName, g.GetHdc(), emfType)) 375using (Metafile metafile = new(fileName, g.GetHdc(), EmfType.EmfPlusDual, description)) 451using (Metafile metafile = new(fileName, g.GetHdc(), _rectangleF)) 467using (Metafile metafile = new(fileName, g.GetHdc(), _rectangleF, frameUnit)) 483using (Metafile metafile = new(fileName, g.GetHdc(), _rectangleF, MetafileFrameUnit.GdiCompatible, emfType)) 500using (Metafile metafile = new( 518using (Metafile metafile = new( 535using (Metafile metafile = new(fileName, g.GetHdc(), _rectangle)) 551using (Metafile metafile = new(fileName, g.GetHdc(), _rectangle, frameUnit)) 567using (Metafile metafile = new(fileName, g.GetHdc(), _rectangle, MetafileFrameUnit.GdiCompatible, emfType)) 584using (Metafile metafile = new( 602using (Metafile metafile = new( 730using Metafile metafile = new(stream, g.GetHdc(), _rectangle); 741using Metafile metafile = new(stream, g.GetHdc(), _rectangle, frameUnit); 752using Metafile metafile = new(stream, g.GetHdc(), _rectangle, MetafileFrameUnit.GdiCompatible, emfType); 764using Metafile metafile = new( 777using Metafile metafile = new( 841MetafileHeader header = Metafile.GetMetafileHeader(GetPath(WmfFile)); 848AssertExtensions.Throws<ArgumentException>(null, () => Metafile.GetMetafileHeader(IntPtr.Zero)); 849using Metafile metafile = new(GetPath(WmfFile)); 850AssertExtensions.Throws<ArgumentException>(null, () => Metafile.GetMetafileHeader(metafile.GetHenhmetafile())); 858AssertExtensions.Throws<ArgumentException>("path", null, () => Metafile.GetMetafileHeader(fileName)); 864AssertExtensions.Throws<ArgumentNullException>("path", () => Metafile.GetMetafileHeader((string)null)); 871MetafileHeader header = Metafile.GetMetafileHeader(stream); 878Assert.Throws<ArgumentNullException>(() => Metafile.GetMetafileHeader((Stream)null)); 885AssertExtensions.Throws<ArgumentException>(null, () => Metafile.GetMetafileHeader(stream)); 891using Metafile metafile = new(GetPath(WmfFile)); 901Metafile metafile = new(GetPath(WmfFile)); 910using Metafile metafile = new(GetPath(WmfFile)); 917Metafile metafile = new(GetPath(WmfFile)); 926Metafile metafile = new(GetPath(WmfFile)); 962private void AssertMetafileIsBlank(Metafile metafile) 982private void AssertMetafile(Metafile metafile) 1033Metafile 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)
70Metafile result = Assert.IsType<Metafile>(editor.LoadFromStream(stream));
System.Windows.Forms.Primitives (2)
System\Drawing\ImageExtensions.cs (2)
35using (Metafile metafile = new((HMETAFILE)handle, header, deleteWmf: false)) 41using (Metafile metafile = new((HENHMETAFILE)handle, deleteEmf: false))
System.Windows.Forms.Tests (19)
System\Windows\Forms\AxHostTests.cs (8)
1634Metafile original = new("bitmaps/milkmateya01.emf"); 1649var result = Assert.IsType<Metafile>(SubAxHost.GetPictureFromIPictureDisp(disp)); 1656Metafile original = new("bitmaps/telescope_01.wmf"); 1699Metafile original = new("bitmaps/milkmateya01.emf"); 1717var result = Assert.IsType<Metafile>(SubAxHost.GetPictureFromIPicture(iPicture)); 1724Metafile original = new("bitmaps/telescope_01.wmf");
System\Windows\Forms\ClipboardTests.cs (4)
295using Metafile metafile = new("bitmaps/telescope_01.wmf"); 296using Metafile enhancedMetafile = new("bitmaps/milkmateya01.emf"); 364using Metafile metafile = new("bitmaps/telescope_01.wmf"); 385using Metafile metafile = new("bitmaps/milkmateya01.emf");
System\Windows\Forms\DataObjectTests.cs (1)
1930using var metafile = new Drawing.Imaging.Metafile("bitmaps/milkmateya01.emf");
System\Windows\Forms\ImageList.ImageCollectionTests.cs (4)
341using Metafile value = new("bitmaps/telescope_01.wmf"); 808using Metafile value = new("bitmaps/telescope_01.wmf"); 885using Metafile value = new("bitmaps/telescope_01.wmf"); 1725using Metafile value = new("bitmaps/telescope_01.wmf");
System\Windows\Forms\TextRendererTests.cs (2)
755using (Metafile metafileRecorder = new(stream, hdc.HDC, EmfType.EmfOnly)) 779using Metafile metafile = new(stream);