171 instantiations of Metafile
PresentationFramework-SystemDrawing (3)
SystemDrawingExtension.cs (3)
61return new Metafile(hMetafile, false); 100Metafile metafile = new Metafile(handle, false); 129Metafile metafile = new Metafile(metafileStream);
System.Drawing.Common.Tests (138)
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)
285using Metafile image = new(Helpers.GetTestBitmapPath("telescope_01.wmf"));
System\Drawing\Imaging\MetafileTests.cs (124)
40AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(IntPtr.Zero, false)); 46using Metafile metafile = new(GetPath(WmfFile)); 47Assert.Throws<ExternalException>(() => new Metafile(metafile.GetHenhmetafile(), false)); 53using Metafile metafile = new(GetPath(WmfFile)); 60Assert.Throws<ExternalException>(() => new Metafile(GetPath(BmpFile))); 66AssertExtensions.Throws<ArgumentNullException>("path", () => new Metafile((string)null)); 72Assert.Throws<ExternalException>(() => new Metafile("fileNotExist")); 87AssertExtensions.Throws<ArgumentException>("path", null, () => new Metafile(path)); 94using Metafile metafile = new(stream); 101AssertExtensions.Throws<ArgumentNullException, ArgumentException>("stream", null, () => new Metafile((Stream)null)); 108Assert.Throws<ExternalException>(() => new Metafile(stream)); 124using Metafile metafile = new(g.GetHdc(), emfType); 143AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(g.GetHdc(), emfType)); 149AssertExtensions.Throws<ArgumentException>(null, () => new Metafile((IntPtr)null, EmfType.EmfOnly)); 155AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(IntPtr.Zero, EmfType.EmfOnly)); 170using Metafile metafile = new(g.GetHdc(), EmfType.EmfOnly, description); 178AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(IntPtr.Zero, EmfType.EmfOnly, description)); 186using Metafile metafile = new(g.GetHdc(), _rectangleF); 206using Metafile metafile = new(g.GetHdc(), _rectangleF, frameUnit); 216using Metafile metafile = new(g.GetHdc(), _rectangleF, MetafileFrameUnit.Pixel, emfType); 227using Metafile metafile = new(g.GetHdc(), _rectangleF, MetafileFrameUnit.Pixel, EmfType.EmfOnly, description); 236using Metafile metafile = new(g.GetHdc(), _rectangle); 246using Metafile metafile = new(g.GetHdc(), _rectangle, frameUnit); 256using Metafile metafile = new(g.GetHdc(), _rectangle, MetafileFrameUnit.Pixel, emfType); 267using Metafile metafile = new(g.GetHdc(), _rectangle, MetafileFrameUnit.Pixel, EmfType.EmfOnly, description); 274AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(IntPtr.Zero, _rectangleF)); 275AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(IntPtr.Zero, _rectangleF, MetafileFrameUnit.Pixel)); 277new Metafile(IntPtr.Zero, _rectangleF, MetafileFrameUnit.Pixel, EmfType.EmfOnly)); 279new Metafile(IntPtr.Zero, _rectangleF, MetafileFrameUnit.Pixel, EmfType.EmfOnly, "description")); 281AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(IntPtr.Zero, _rectangle)); 282AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(IntPtr.Zero, _rectangle, MetafileFrameUnit.Pixel)); 284new Metafile(IntPtr.Zero, _rectangle, MetafileFrameUnit.Pixel, EmfType.EmfOnly)); 286new Metafile(IntPtr.Zero, _rectangle, MetafileFrameUnit.Pixel, EmfType.EmfOnly, "description")); 304AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(referenceHdc, _rectangleF, farameUnit)); 305AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(referenceHdc, _rectangleF, farameUnit, EmfType.EmfOnly)); 307new Metafile(referenceHdc, _rectangleF, farameUnit, EmfType.EmfOnly, "description")); 309AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(referenceHdc, _rectangle, farameUnit)); 310AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(referenceHdc, _rectangle, farameUnit, EmfType.EmfOnly)); 312new Metafile(referenceHdc, _rectangle, farameUnit, EmfType.EmfOnly, "description")); 323new Metafile(referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, emfType)); 325new Metafile(referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, emfType, "description")); 328new Metafile(referenceHdc, _rectangle, MetafileFrameUnit.GdiCompatible, emfType)); 330new Metafile(referenceHdc, _rectangle, MetafileFrameUnit.GdiCompatible, emfType, "description")); 339using (Metafile metafile = new(fileName, g.GetHdc())) 355using (Metafile metafile = new(fileName, g.GetHdc(), emfType)) 372using (Metafile metafile = new(fileName, g.GetHdc(), EmfType.EmfPlusDual, description)) 386AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, IntPtr.Zero)); 387AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, IntPtr.Zero, EmfType.EmfOnly)); 388AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, IntPtr.Zero, EmfType.EmfOnly, "description")); 400AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, referenceHdc, emfType)); 401AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, referenceHdc, emfType, "description")); 411AssertExtensions.Throws<ArgumentNullException>("path", () => new Metafile((string)null, referenceHdc)); 412AssertExtensions.Throws<ArgumentNullException>("path", () => new Metafile((string)null, referenceHdc, EmfType.EmfOnly)); 413AssertExtensions.Throws<ArgumentNullException>("path", () => new Metafile((string)null, referenceHdc, EmfType.EmfOnly, "description")); 424AssertExtensions.Throws<ArgumentException>("path", null, () => new Metafile(fileName, referenceHdc)); 425AssertExtensions.Throws<ArgumentException>("path", null, () => new Metafile(fileName, referenceHdc, EmfType.EmfOnly)); 426AssertExtensions.Throws<ArgumentException>("path", null, () => new Metafile(fileName, referenceHdc, EmfType.EmfOnly, "description")); 436Assert.Throws<PathTooLongException>(() => new Metafile(fileName, referenceHdc)); 437Assert.Throws<PathTooLongException>(() => new Metafile(fileName, referenceHdc, EmfType.EmfOnly)); 438Assert.Throws<PathTooLongException>(() => new Metafile(fileName, referenceHdc, EmfType.EmfOnly, "description")); 448using (Metafile metafile = new(fileName, g.GetHdc(), _rectangleF)) 464using (Metafile metafile = new(fileName, g.GetHdc(), _rectangleF, frameUnit)) 480using (Metafile metafile = new(fileName, g.GetHdc(), _rectangleF, MetafileFrameUnit.GdiCompatible, emfType)) 497using (Metafile metafile = new( 515using (Metafile metafile = new( 532using (Metafile metafile = new(fileName, g.GetHdc(), _rectangle)) 548using (Metafile metafile = new(fileName, g.GetHdc(), _rectangle, frameUnit)) 564using (Metafile metafile = new(fileName, g.GetHdc(), _rectangle, MetafileFrameUnit.GdiCompatible, emfType)) 581using (Metafile metafile = new( 599using (Metafile metafile = new( 614AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, IntPtr.Zero, _rectangleF)); 615AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, IntPtr.Zero, _rectangleF, MetafileFrameUnit.GdiCompatible)); 617new Metafile(fileName, IntPtr.Zero, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly)); 619new Metafile(fileName, IntPtr.Zero, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly, "description")); 621AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, IntPtr.Zero, _rectangle)); 622AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, IntPtr.Zero, _rectangle, MetafileFrameUnit.GdiCompatible)); 624new Metafile(fileName, IntPtr.Zero, _rectangle, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly)); 626new Metafile(fileName, IntPtr.Zero, _rectangle, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly, "description")); 638AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, referenceHdc, _rectangleF, frameUnit)); 640new Metafile(fileName, referenceHdc, _rectangleF, frameUnit, EmfType.EmfOnly)); 642new Metafile(fileName, referenceHdc, _rectangleF, frameUnit, EmfType.EmfOnly, "description")); 644AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, referenceHdc, _rectangle, frameUnit)); 646new Metafile(fileName, referenceHdc, _rectangle, frameUnit, EmfType.EmfOnly)); 648new Metafile(fileName, referenceHdc, _rectangle, frameUnit, EmfType.EmfOnly, "description")); 661new Metafile(fileName, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, emfType)); 663new Metafile(fileName, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, emfType, "description")); 666new Metafile(fileName, referenceHdc, _rectangle, MetafileFrameUnit.GdiCompatible, emfType)); 668new Metafile(fileName, referenceHdc, _rectangle, MetafileFrameUnit.GdiCompatible, emfType, "description")); 678AssertExtensions.Throws<ArgumentNullException>("path", () => new Metafile((string)null, referenceHdc, _rectangleF)); 680new Metafile((string)null, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible)); 682new Metafile((string)null, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly)); 684new Metafile((string)null, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly, "description")); 695AssertExtensions.Throws<ArgumentException, ArgumentException>("path", null, () => new Metafile(fileName, referenceHdc, _rectangleF)); 697new Metafile(fileName, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible)); 699new Metafile(fileName, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly)); 701new Metafile(fileName, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly, "description")); 711Assert.Throws<PathTooLongException>(() => new Metafile(fileName, referenceHdc, _rectangleF)); 713new Metafile(fileName, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible)); 715new Metafile(fileName, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly)); 717new Metafile(fileName, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly, "description")); 727using Metafile metafile = new(stream, g.GetHdc(), _rectangle); 738using Metafile metafile = new(stream, g.GetHdc(), _rectangle, frameUnit); 749using Metafile metafile = new(stream, g.GetHdc(), _rectangle, MetafileFrameUnit.GdiCompatible, emfType); 761using Metafile metafile = new( 774using Metafile metafile = new( 784AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(stream, IntPtr.Zero, _rectangle)); 785AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(stream, IntPtr.Zero, _rectangle, MetafileFrameUnit.GdiCompatible)); 787new Metafile(stream, IntPtr.Zero, _rectangle, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly)); 789new Metafile(stream, IntPtr.Zero, _rectangle, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly, "description")); 800AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(stream, referenceHdc, _rectangle, frameUnit)); 802new Metafile(stream, referenceHdc, _rectangle, frameUnit, EmfType.EmfOnly)); 804new Metafile(stream, referenceHdc, _rectangle, frameUnit, EmfType.EmfOnly, "description")); 816new Metafile(stream, referenceHdc, _rectangle, MetafileFrameUnit.GdiCompatible, emfType)); 818new Metafile(stream, referenceHdc, _rectangle, MetafileFrameUnit.GdiCompatible, emfType, "description")); 827Assert.Throws<ArgumentNullException>(() => new Metafile((Stream)null, referenceHdc, _rectangleF)); 828Assert.Throws<ArgumentNullException>(() => new Metafile((Stream)null, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible)); 830new Metafile((Stream)null, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly)); 832new Metafile((Stream)null, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible, EmfType.EmfOnly, "description")); 846using Metafile metafile = new(GetPath(WmfFile)); 888using Metafile metafile = new(GetPath(WmfFile)); 898Metafile metafile = new(GetPath(WmfFile)); 907using Metafile metafile = new(GetPath(WmfFile)); 914Metafile metafile = new(GetPath(WmfFile)); 923Metafile metafile = new(GetPath(WmfFile));
System\Drawing\TextureBrushTests.cs (1)
14yield 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)
1632Metafile original = new("bitmaps/milkmateya01.emf"); 1654Metafile original = new("bitmaps/telescope_01.wmf"); 1697Metafile original = new("bitmaps/milkmateya01.emf"); 1722Metafile original = new("bitmaps/telescope_01.wmf");
System\Windows\Forms\ClipboardTests.cs (4)
379using Metafile metafile = new("bitmaps/telescope_01.wmf"); 380using Metafile enhancedMetafile = new("bitmaps/milkmateya01.emf"); 447using Metafile metafile = new("bitmaps/telescope_01.wmf"); 464using Metafile metafile = new("bitmaps/milkmateya01.emf");
System\Windows\Forms\ControlPaintTests.cs (7)
1316yield return new object[] { new Metafile("bitmaps/telescope_01.wmf"), -10, -20, Color.Red }; 1317yield return new object[] { new Metafile("bitmaps/telescope_01.wmf"), 0, 0, Color.Red }; 1318yield return new object[] { new Metafile("bitmaps/telescope_01.wmf"), 1, 2, Color.Red }; 1319yield return new object[] { new Metafile("bitmaps/telescope_01.wmf"), 0, 0, Color.Black }; 1320yield return new object[] { new Metafile("bitmaps/telescope_01.wmf"), 0, 0, Color.White }; 1321yield return new object[] { new Metafile("bitmaps/telescope_01.wmf"), 0, 0, Color.Transparent }; 1322yield return new object[] { new Metafile("bitmaps/telescope_01.wmf"), 0, 0, Color.Empty };
System\Windows\Forms\DataObjectTests.cs (1)
1568using var metafile = new Drawing.Imaging.Metafile("bitmaps/milkmateya01.emf");
System\Windows\Forms\ImageList.ImageCollectionTests.cs (11)
339using Metafile value = new("bitmaps/telescope_01.wmf"); 806using Metafile value = new("bitmaps/telescope_01.wmf"); 883using Metafile value = new("bitmaps/telescope_01.wmf"); 1058yield return new object[] { new Metafile("bitmaps/telescope_01.wmf") }; 1272yield return new object[] { new Metafile("bitmaps/telescope_01.wmf") }; 1288yield return new object[] { new Metafile("bitmaps/telescope_01.wmf") }; 1723using Metafile value = new("bitmaps/telescope_01.wmf"); 1730yield return new object[] { new Metafile("bitmaps/telescope_01.wmf") }; 1761yield return new object[] { new Metafile("bitmaps/telescope_01.wmf") }; 1796yield return new object[] { index, new Metafile("bitmaps/telescope_01.wmf") }; 1813yield return new object[] { new Metafile("bitmaps/telescope_01.wmf") };
System\Windows\Forms\TextRendererTests.cs (2)
753using (Metafile metafileRecorder = new(stream, hdc.HDC, EmfType.EmfOnly)) 777using Metafile metafile = new(stream);
140 references to Metafile
PresentationFramework-SystemDrawing (5)
SystemDrawingExtension.cs (5)
40return data is Metafile; 47Metafile metafile = data as Metafile; 100Metafile metafile = new Metafile(handle, false); 129Metafile metafile = new Metafile(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 (71)
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)
285using 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 (47)
46using Metafile metafile = new(GetPath(WmfFile)); 53using Metafile metafile = new(GetPath(WmfFile)); 94using Metafile metafile = new(stream); 124using Metafile metafile = new(g.GetHdc(), emfType); 170using Metafile metafile = new(g.GetHdc(), EmfType.EmfOnly, description); 186using Metafile metafile = new(g.GetHdc(), _rectangleF); 206using Metafile metafile = new(g.GetHdc(), _rectangleF, frameUnit); 216using Metafile metafile = new(g.GetHdc(), _rectangleF, MetafileFrameUnit.Pixel, emfType); 227using Metafile metafile = new(g.GetHdc(), _rectangleF, MetafileFrameUnit.Pixel, EmfType.EmfOnly, description); 236using Metafile metafile = new(g.GetHdc(), _rectangle); 246using Metafile metafile = new(g.GetHdc(), _rectangle, frameUnit); 256using Metafile metafile = new(g.GetHdc(), _rectangle, MetafileFrameUnit.Pixel, emfType); 267using Metafile metafile = new(g.GetHdc(), _rectangle, MetafileFrameUnit.Pixel, EmfType.EmfOnly, description); 339using (Metafile metafile = new(fileName, g.GetHdc())) 355using (Metafile metafile = new(fileName, g.GetHdc(), emfType)) 372using (Metafile metafile = new(fileName, g.GetHdc(), EmfType.EmfPlusDual, description)) 448using (Metafile metafile = new(fileName, g.GetHdc(), _rectangleF)) 464using (Metafile metafile = new(fileName, g.GetHdc(), _rectangleF, frameUnit)) 480using (Metafile metafile = new(fileName, g.GetHdc(), _rectangleF, MetafileFrameUnit.GdiCompatible, emfType)) 497using (Metafile metafile = new( 515using (Metafile metafile = new( 532using (Metafile metafile = new(fileName, g.GetHdc(), _rectangle)) 548using (Metafile metafile = new(fileName, g.GetHdc(), _rectangle, frameUnit)) 564using (Metafile metafile = new(fileName, g.GetHdc(), _rectangle, MetafileFrameUnit.GdiCompatible, emfType)) 581using (Metafile metafile = new( 599using (Metafile metafile = new( 727using Metafile metafile = new(stream, g.GetHdc(), _rectangle); 738using Metafile metafile = new(stream, g.GetHdc(), _rectangle, frameUnit); 749using Metafile metafile = new(stream, g.GetHdc(), _rectangle, MetafileFrameUnit.GdiCompatible, emfType); 761using Metafile metafile = new( 774using Metafile metafile = new( 838MetafileHeader header = Metafile.GetMetafileHeader(GetPath(WmfFile)); 845AssertExtensions.Throws<ArgumentException>(null, () => Metafile.GetMetafileHeader(IntPtr.Zero)); 846using Metafile metafile = new(GetPath(WmfFile)); 847AssertExtensions.Throws<ArgumentException>(null, () => Metafile.GetMetafileHeader(metafile.GetHenhmetafile())); 855AssertExtensions.Throws<ArgumentException>("path", null, () => Metafile.GetMetafileHeader(fileName)); 861AssertExtensions.Throws<ArgumentNullException>("path", () => Metafile.GetMetafileHeader((string)null)); 868MetafileHeader header = Metafile.GetMetafileHeader(stream); 875Assert.Throws<ArgumentNullException>(() => Metafile.GetMetafileHeader((Stream)null)); 882AssertExtensions.Throws<ArgumentException>(null, () => Metafile.GetMetafileHeader(stream)); 888using Metafile metafile = new(GetPath(WmfFile)); 898Metafile metafile = new(GetPath(WmfFile)); 907using Metafile metafile = new(GetPath(WmfFile)); 914Metafile metafile = new(GetPath(WmfFile)); 923Metafile metafile = new(GetPath(WmfFile)); 959private void AssertMetafileIsBlank(Metafile metafile) 979private void AssertMetafile(Metafile metafile)
System.Windows.Forms (3)
System\Drawing\Design\UITypeEditor.cs (1)
59[typeof(Metafile)] = $"System.Drawing.Design.MetafileEditor, {AssemblyRef.SystemDrawingDesign}",
System\Windows\Forms\Control.cs (1)
4799/// 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)
53[InlineData(typeof(Metafile), typeof(MetafileEditor))]
System\Drawing\Design\MetafileEditorTests.cs (2)
68Metafile 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)
1632Metafile original = new("bitmaps/milkmateya01.emf"); 1647var result = Assert.IsType<Metafile>(SubAxHost.GetPictureFromIPictureDisp(disp)); 1654Metafile original = new("bitmaps/telescope_01.wmf"); 1697Metafile original = new("bitmaps/milkmateya01.emf"); 1715var result = Assert.IsType<Metafile>(SubAxHost.GetPictureFromIPicture(iPicture)); 1722Metafile original = new("bitmaps/telescope_01.wmf");
System\Windows\Forms\ClipboardTests.cs (4)
379using Metafile metafile = new("bitmaps/telescope_01.wmf"); 380using Metafile enhancedMetafile = new("bitmaps/milkmateya01.emf"); 447using Metafile metafile = new("bitmaps/telescope_01.wmf"); 464using Metafile metafile = new("bitmaps/milkmateya01.emf");
System\Windows\Forms\DataObjectTests.cs (1)
1568using var metafile = new Drawing.Imaging.Metafile("bitmaps/milkmateya01.emf");
System\Windows\Forms\ImageList.ImageCollectionTests.cs (4)
339using Metafile value = new("bitmaps/telescope_01.wmf"); 806using Metafile value = new("bitmaps/telescope_01.wmf"); 883using Metafile value = new("bitmaps/telescope_01.wmf"); 1723using Metafile value = new("bitmaps/telescope_01.wmf");
System\Windows\Forms\TextRendererTests.cs (2)
753using (Metafile metafileRecorder = new(stream, hdc.HDC, EmfType.EmfOnly)) 777using Metafile metafile = new(stream);