111 references to EmfType
System.Drawing (1)
System.Drawing.cs (1)
79
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.Imaging.
EmfType
))]
System.Drawing.Common (18)
Special\NotSupported.cs (18)
2536
public Metafile(System.IntPtr referenceHdc, System.Drawing.Imaging.
EmfType
emfType) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
2537
public Metafile(System.IntPtr referenceHdc, System.Drawing.Imaging.
EmfType
emfType, string? description) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
2542
public Metafile(System.IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.
EmfType
type) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
2543
public Metafile(System.IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.
EmfType
type, string? desc) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
2546
public Metafile(System.IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.
EmfType
type) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
2547
public Metafile(System.IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.
EmfType
type, string? description) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
2550
public Metafile(System.IO.Stream stream, System.IntPtr referenceHdc, System.Drawing.Imaging.
EmfType
type) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
2551
public Metafile(System.IO.Stream stream, System.IntPtr referenceHdc, System.Drawing.Imaging.
EmfType
type, string? description) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
2554
public Metafile(System.IO.Stream stream, System.IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.
EmfType
type) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
2555
public Metafile(System.IO.Stream stream, System.IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.
EmfType
type, string? description) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
2558
public Metafile(System.IO.Stream stream, System.IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.
EmfType
type) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
2559
public Metafile(System.IO.Stream stream, System.IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.
EmfType
type, string? description) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
2562
public Metafile(string fileName, System.IntPtr referenceHdc, System.Drawing.Imaging.
EmfType
type) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
2563
public Metafile(string fileName, System.IntPtr referenceHdc, System.Drawing.Imaging.
EmfType
type, string? description) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
2566
public Metafile(string fileName, System.IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.
EmfType
type) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
2567
public Metafile(string fileName, System.IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.
EmfType
type, string? description) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
2571
public Metafile(string fileName, System.IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.
EmfType
type) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
2572
public Metafile(string fileName, System.IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.
EmfType
type, string? description) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
System.Drawing.Common.Tests (91)
mono\System.Imaging\MetafileTest.cs (12)
188
private static void CheckEmptyHeader(Metafile mf,
EmfType
type)
198
case
EmfType
.EmfOnly:
201
case
EmfType
.EmfPlusDual:
204
case
EmfType
.EmfPlusOnly:
222
CheckEmptyHeader(mf,
EmfType
.EmfPlusDual);
239
CheckEmptyHeader(mf,
EmfType
.EmfPlusDual);
247
private void Metafile_StreamEmfType(Stream stream,
EmfType
type)
266
Assert.Throws<ArgumentNullException>(() => Metafile_StreamEmfType(null,
EmfType
.EmfOnly));
273
Metafile_StreamEmfType(ms,
EmfType
.EmfOnly);
280
Assert.Throws<ArgumentException>(() => Metafile_StreamEmfType(ms, (
EmfType
)int.MinValue));
295
mf = new Metafile(hdc,
EmfType
.EmfPlusOnly);
337
mf = new Metafile(hdc,
EmfType
.EmfPlusOnly);
System\Drawing\Imaging\MetafileTests.cs (79)
113
yield return new object[] {
EmfType
.EmfOnly };
114
yield return new object[] {
EmfType
.EmfPlusDual };
115
yield return new object[] {
EmfType
.EmfPlusOnly };
120
public void Ctor_IntPtrEmfType_Success(
EmfType
emfType)
131
yield return new object[] { (
EmfType
.EmfOnly - 1) };
132
yield return new object[] { (
EmfType
.EmfPlusDual + 1) };
133
yield return new object[] { (
EmfType
)int.MaxValue };
134
yield return new object[] { (
EmfType
)int.MinValue };
139
public void Ctor_IntPtrInvalidEmfType_ThrowsArgumentException(
EmfType
emfType)
149
AssertExtensions.Throws<ArgumentException>(null, () => new Metafile((IntPtr)null,
EmfType
.EmfOnly));
155
AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(IntPtr.Zero,
EmfType
.EmfOnly));
170
using Metafile metafile = new(g.GetHdc(),
EmfType
.EmfOnly, description);
178
AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(IntPtr.Zero,
EmfType
.EmfOnly, description));
212
public void Ctor_IntPtrRectangleFMetafileFrameUnitEmfType_Success(
EmfType
emfType)
227
using Metafile metafile = new(g.GetHdc(), _rectangleF, MetafileFrameUnit.Pixel,
EmfType
.EmfOnly, description);
252
public void Ctor_IntPtrRectangleMetafileFrameUnitEmfType_Success(
EmfType
emfType)
267
using Metafile metafile = new(g.GetHdc(), _rectangle, MetafileFrameUnit.Pixel,
EmfType
.EmfOnly, description);
277
new Metafile(IntPtr.Zero, _rectangleF, MetafileFrameUnit.Pixel,
EmfType
.EmfOnly));
279
new Metafile(IntPtr.Zero, _rectangleF, MetafileFrameUnit.Pixel,
EmfType
.EmfOnly, "description"));
284
new Metafile(IntPtr.Zero, _rectangle, MetafileFrameUnit.Pixel,
EmfType
.EmfOnly));
286
new Metafile(IntPtr.Zero, _rectangle, MetafileFrameUnit.Pixel,
EmfType
.EmfOnly, "description"));
305
AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(referenceHdc, _rectangleF, farameUnit,
EmfType
.EmfOnly));
307
new Metafile(referenceHdc, _rectangleF, farameUnit,
EmfType
.EmfOnly, "description"));
310
AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(referenceHdc, _rectangle, farameUnit,
EmfType
.EmfOnly));
312
new Metafile(referenceHdc, _rectangle, farameUnit,
EmfType
.EmfOnly, "description"));
317
public void Ctor_InvalidEmfType_ThrowsArgumentException(
EmfType
emfType)
350
public void Ctor_StringIntPtrEmfType_Success(
EmfType
emfType)
372
using (Metafile metafile = new(fileName, g.GetHdc(),
EmfType
.EmfPlusDual, description))
375
AssertEmfType(metafile.GetMetafileHeader(),
EmfType
.EmfPlusDual);
387
AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, IntPtr.Zero,
EmfType
.EmfOnly));
388
AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, IntPtr.Zero,
EmfType
.EmfOnly, "description"));
394
public void Ctor_InvalidEmfTypeI_ThrowsArgumentException(
EmfType
emfType)
412
AssertExtensions.Throws<ArgumentNullException>("path", () => new Metafile((string)null, referenceHdc,
EmfType
.EmfOnly));
413
AssertExtensions.Throws<ArgumentNullException>("path", () => new Metafile((string)null, referenceHdc,
EmfType
.EmfOnly, "description"));
425
AssertExtensions.Throws<ArgumentException>("path", null, () => new Metafile(fileName, referenceHdc,
EmfType
.EmfOnly));
426
AssertExtensions.Throws<ArgumentException>("path", null, () => new Metafile(fileName, referenceHdc,
EmfType
.EmfOnly, "description"));
437
Assert.Throws<PathTooLongException>(() => new Metafile(fileName, referenceHdc,
EmfType
.EmfOnly));
438
Assert.Throws<PathTooLongException>(() => new Metafile(fileName, referenceHdc,
EmfType
.EmfOnly, "description"));
475
public void Ctor_StringIntPtrRectangleFMetafileFrameUnitEmfType_Success(
EmfType
emfType)
498
fileName, g.GetHdc(), _rectangleF, MetafileFrameUnit.GdiCompatible,
EmfType
.EmfOnly, description))
501
AssertEmfType(metafile.GetMetafileHeader(),
EmfType
.EmfOnly);
516
fileName, g.GetHdc(), default(RectangleF), MetafileFrameUnit.GdiCompatible,
EmfType
.EmfOnly, description))
519
AssertEmfType(metafile.GetMetafileHeader(),
EmfType
.EmfOnly);
559
public void Ctor_StringIntPtrRectangleMetafileFrameUnitEmfType_Success(
EmfType
emfType)
582
fileName, g.GetHdc(), _rectangle, MetafileFrameUnit.GdiCompatible,
EmfType
.EmfOnly, description))
585
AssertEmfType(metafile.GetMetafileHeader(),
EmfType
.EmfOnly);
600
fileName, g.GetHdc(), default, MetafileFrameUnit.GdiCompatible,
EmfType
.EmfOnly, description))
603
AssertEmfType(metafile.GetMetafileHeader(),
EmfType
.EmfOnly);
617
new Metafile(fileName, IntPtr.Zero, _rectangleF, MetafileFrameUnit.GdiCompatible,
EmfType
.EmfOnly));
619
new Metafile(fileName, IntPtr.Zero, _rectangleF, MetafileFrameUnit.GdiCompatible,
EmfType
.EmfOnly, "description"));
624
new Metafile(fileName, IntPtr.Zero, _rectangle, MetafileFrameUnit.GdiCompatible,
EmfType
.EmfOnly));
626
new Metafile(fileName, IntPtr.Zero, _rectangle, MetafileFrameUnit.GdiCompatible,
EmfType
.EmfOnly, "description"));
640
new Metafile(fileName, referenceHdc, _rectangleF, frameUnit,
EmfType
.EmfOnly));
642
new Metafile(fileName, referenceHdc, _rectangleF, frameUnit,
EmfType
.EmfOnly, "description"));
646
new Metafile(fileName, referenceHdc, _rectangle, frameUnit,
EmfType
.EmfOnly));
648
new Metafile(fileName, referenceHdc, _rectangle, frameUnit,
EmfType
.EmfOnly, "description"));
654
public void Ctor_InvalidEmfTypeII_ThrowsArgumentException(
EmfType
emfType)
682
new Metafile((string)null, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible,
EmfType
.EmfOnly));
684
new Metafile((string)null, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible,
EmfType
.EmfOnly, "description"));
699
new Metafile(fileName, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible,
EmfType
.EmfOnly));
701
new Metafile(fileName, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible,
EmfType
.EmfOnly, "description"));
715
new Metafile(fileName, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible,
EmfType
.EmfOnly));
717
new Metafile(fileName, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible,
EmfType
.EmfOnly, "description"));
744
public void Ctor_StreamIntPtrRectangleMetafileFrameUnitEmfType_Success(
EmfType
emfType)
762
stream, g.GetHdc(), _rectangle, MetafileFrameUnit.GdiCompatible,
EmfType
.EmfOnly, description);
764
AssertEmfType(metafile.GetMetafileHeader(),
EmfType
.EmfOnly);
775
stream, g.GetHdc(), default, MetafileFrameUnit.GdiCompatible,
EmfType
.EmfOnly, description);
777
AssertEmfType(metafile.GetMetafileHeader(),
EmfType
.EmfOnly);
787
new Metafile(stream, IntPtr.Zero, _rectangle, MetafileFrameUnit.GdiCompatible,
EmfType
.EmfOnly));
789
new Metafile(stream, IntPtr.Zero, _rectangle, MetafileFrameUnit.GdiCompatible,
EmfType
.EmfOnly, "description"));
802
new Metafile(stream, referenceHdc, _rectangle, frameUnit,
EmfType
.EmfOnly));
804
new Metafile(stream, referenceHdc, _rectangle, frameUnit,
EmfType
.EmfOnly, "description"));
809
public void Ctor_InvalidEmfTypeIII_ThrowsArgumentException(
EmfType
emfType)
830
new Metafile((Stream)null, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible,
EmfType
.EmfOnly));
832
new Metafile((Stream)null, referenceHdc, _rectangleF, MetafileFrameUnit.GdiCompatible,
EmfType
.EmfOnly, "description"));
943
private static void AssertEmfType(MetafileHeader metafileHeader,
EmfType
emfType)
947
case
EmfType
.EmfOnly:
950
case
EmfType
.EmfPlusDual:
953
case
EmfType
.EmfPlusOnly:
System.Windows.Forms.Tests (1)
System\Windows\Forms\TextRendererTests.cs (1)
753
using (Metafile metafileRecorder = new(stream, hdc.HDC,
EmfType
.EmfOnly))