173 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 (1)
System\Drawing\Image.cs (1)
861GdiPlus.ImageType.ImageTypeMetafile => new Metafile((nint)nativeImage),
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)
285using 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)
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)
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)
392using Metafile metafile = new("bitmaps/telescope_01.wmf"); 393using Metafile enhancedMetafile = new("bitmaps/milkmateya01.emf"); 461using Metafile metafile = new("bitmaps/telescope_01.wmf"); 482using 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);
210 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 (106)
System\Drawing\Graphics.cs (36)
2449public void EnumerateMetafile(Metafile metafile, PointF destPoint, EnumerateMetafileProc callback) => 2452public void EnumerateMetafile(Metafile metafile, PointF destPoint, EnumerateMetafileProc callback, IntPtr callbackData) => 2455public void EnumerateMetafile(Metafile metafile, Point destPoint, EnumerateMetafileProc callback) => 2458public void EnumerateMetafile(Metafile metafile, Point destPoint, EnumerateMetafileProc callback, IntPtr callbackData) => 2461public void EnumerateMetafile(Metafile metafile, RectangleF destRect, EnumerateMetafileProc callback) => 2464public void EnumerateMetafile(Metafile metafile, RectangleF destRect, EnumerateMetafileProc callback, IntPtr callbackData) => 2467public void EnumerateMetafile(Metafile metafile, Rectangle destRect, EnumerateMetafileProc callback) => 2470public void EnumerateMetafile(Metafile metafile, Rectangle destRect, EnumerateMetafileProc callback, IntPtr callbackData) => 2473public void EnumerateMetafile(Metafile metafile, PointF[] destPoints, EnumerateMetafileProc callback) => 2477Metafile metafile, 2482public void EnumerateMetafile(Metafile metafile, Point[] destPoints, EnumerateMetafileProc callback) => 2485public void EnumerateMetafile(Metafile metafile, Point[] destPoints, EnumerateMetafileProc callback, IntPtr callbackData) => 2489Metafile metafile, 2496Metafile metafile, 2504Metafile metafile, 2511Metafile metafile, 2519Metafile metafile, 2526Metafile metafile, 2534Metafile metafile, 2541Metafile metafile, 2549Metafile metafile, 2556Metafile metafile, 2564Metafile metafile, 2571Metafile metafile, 2940Metafile metafile, 2961Metafile metafile, 2969Metafile metafile, 2990Metafile metafile, 2997Metafile metafile, 3026Metafile metafile, 3055Metafile metafile, 3080Metafile metafile, 3096Metafile metafile, 3121Metafile metafile, 3130Metafile metafile, 3163Metafile metafile,
System\Drawing\Imaging\Metafile.cs (46)
27/// Initializes a new instance of the <see cref='Metafile'/> class from the specified handle and 46/// Initializes a new instance of the <see cref='Metafile'/> class from the specified handle and 57/// Initializes a new instance of the <see cref='Metafile'/> class from the specified filename. 72/// Initializes a new instance of the <see cref='Metafile'/> class from the specified device context, bounded 81/// Initializes a new instance of the <see cref='Metafile'/> class from the specified handle to a device context. 89/// Initializes a new instance of the <see cref='Metafile'/> class from the specified device context, bounded 98/// Initializes a new instance of the <see cref='Metafile'/> class from the specified device context, bounded 107/// Initializes a new instance of the <see cref='Metafile'/> class from the specified device context, bounded 116/// Initializes a new instance of the <see cref='Metafile'/> class from the specified device context, bounded 139/// Initializes a new instance of the <see cref='Metafile'/> class from the specified device context, bounded 148/// Initializes a new instance of the <see cref='Metafile'/> class from the specified device context, bounded 157/// Initializes a new instance of the <see cref='Metafile'/> class with the specified filename. 165/// Initializes a new instance of the <see cref='Metafile'/> class with the specified filename. 173/// Initializes a new instance of the <see cref='Metafile'/> class with the specified filename. 181/// Initializes a new instance of the <see cref='Metafile'/> class with the specified filename. 189/// Initializes a new instance of the <see cref='Metafile'/> class with the specified filename. 197/// Initializes a new instance of the <see cref='Metafile'/> class with the specified filename. 205/// Initializes a new instance of the <see cref='Metafile'/> class with the specified filename. 235/// Initializes a new instance of the <see cref='Metafile'/> class with the specified filename. 243/// Initializes a new instance of the <see cref='Metafile'/> class with the specified filename. 251/// Initializes a new instance of the <see cref='Metafile'/> class with the specified filename. 259/// Initializes a new instance of the <see cref='Metafile'/> class with the specified filename. 267/// Initializes a new instance of the <see cref='Metafile'/> class from the specified data stream. 275/// Initializes a new instance of the <see cref='Metafile'/> class from the specified data stream. 283/// Initializes a new instance of the <see cref='Metafile'/> class from the specified data stream. 291/// Initializes a new instance of the <see cref='Metafile'/> class with the specified filename. 299/// Initializes a new instance of the <see cref='Metafile'/> class with the specified filename. 307/// Initializes a new instance of the <see cref='Metafile'/> class from the specified data stream. 315/// Initializes a new instance of the <see cref='Metafile'/> class with the specified filename. 323/// Initializes a new instance of the <see cref='Metafile'/> class with the specified filename. 331/// Initializes a new instance of the <see cref='Metafile'/> class from the specified handle and 340/// Initializes a new instance of the <see cref='Metafile'/> class from the specified stream. 353/// Initializes a new instance of the <see cref='Metafile'/> class from the specified handle to a device context. 373/// Initializes a new instance of the <see cref='Metafile'/> class from the specified device context, bounded 397/// Initializes a new instance of the <see cref='Metafile'/> class with the specified filename. 422/// Initializes a new instance of the <see cref='Metafile'/> class with the specified filename. 448/// Initializes a new instance of the <see cref='Metafile'/> class from the specified data stream. 472/// Initializes a new instance of the <see cref='Metafile'/> class with the specified filename. 497/// Initializes a new instance of the <see cref='Metafile'/> class with the specified filename. 526/// Initializes a new instance of the <see cref="Metafile"/> class from a native metafile handle. 553/// Returns the <see cref='MetafileHeader'/> associated with the specified <see cref='Metafile'/>. 568/// Returns the <see cref='MetafileHeader'/> associated with the specified <see cref='Metafile'/>. 581/// Returns the <see cref='MetafileHeader'/> associated with the specified <see cref='Metafile'/>. 599/// Returns the <see cref='MetafileHeader'/> associated with the specified <see cref='Metafile'/>. 616/// Returns the <see cref='MetafileHeader'/> associated with this <see cref='Metafile'/>. 631/// Returns a Windows handle to an enhanced <see cref='Metafile'/>.
System\Drawing\Imaging\MetafileFrameUnit.cs (1)
8/// This is specified during the creation of the <see cref='Metafile'/>.
System\Drawing\Imaging\MetafileHeader.cs (18)
9/// Contains attributes of an associated <see cref='Metafile'/>. 21/// Gets the type of the associated <see cref='Metafile'/>. 26/// Gets the size, in bytes, of the associated <see cref='Metafile'/>. 31/// Gets the version number of the associated <see cref='Metafile'/>. 36/// Gets the horizontal resolution, in dots-per-inch, of the associated <see cref='Metafile'/>. 41/// Gets the vertical resolution, in dots-per-inch, of the associated <see cref='Metafile'/>. 46/// Gets a <see cref='Rectangle'/> that bounds the associated <see cref='Metafile'/>. 51/// Returns a value indicating whether the associated <see cref='Metafile'/> is in the Windows metafile format. 56/// Returns a value indicating whether the associated <see cref='Metafile'/> is in the Windows Placeable metafile format. 61/// Returns a value indicating whether the associated <see cref='Metafile'/> is in the Windows enhanced metafile format. 66/// Returns a value indicating whether the associated <see cref='Metafile'/> is in the Windows enhanced 74/// Returns a value indicating whether the associated <see cref='Metafile'/> is in the Windows enhanced 81/// Returns a value indicating whether the associated <see cref='Metafile'/> is in the Dual enhanced metafile 87/// Returns a value indicating whether the associated <see cref='Metafile'/> supports only the Windows 93/// Returns a value indicating whether the associated <see cref='Metafile'/> is device-dependent. 98/// Gets the WMF header file for the associated <see cref='Metafile'/>. 110/// Gets the logical horizontal resolution, in dots-per-inch, of the associated <see cref='Metafile'/>. 115/// Gets the logical vertical resolution, in dots-per-inch, of the associated <see cref='Metafile'/>.
System\Drawing\Imaging\MetafileType.cs (1)
7/// Specifies the format of a <see cref='Metafile'/>.
System\Drawing\Imaging\MetaHeader.cs (2)
24/// Represents the type of the associated <see cref='Metafile'/>. 51/// Represents the size, in bytes, of the associated <see cref='Metafile'/>.
System\Drawing\PointerExtensions.cs (1)
28public static GpMetafile* Pointer(this Metafile? metafile) => metafile is null ? null : (GpMetafile*)((Image)metafile).Pointer();
System\Drawing\Printing\PreviewPrintController.cs (1)
65Metafile metafile = new(
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)
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 (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)
392using Metafile metafile = new("bitmaps/telescope_01.wmf"); 393using Metafile enhancedMetafile = new("bitmaps/milkmateya01.emf"); 461using Metafile metafile = new("bitmaps/telescope_01.wmf"); 482using 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);