34 instantiations of ImageFormat
System.Drawing.Common (14)
System\Drawing\Image.cs (1)
510
return new
ImageFormat
(guid);
System\Drawing\ImageFormatConverter.cs (1)
43
return new
ImageFormat
(guid);
System\Drawing\Imaging\ImageFormat.cs (12)
17
private static readonly ImageFormat s_memoryBMP =
new
(PInvokeCore.ImageFormatMemoryBMP);
18
private static readonly ImageFormat s_bmp =
new
(PInvokeCore.ImageFormatBMP);
19
private static readonly ImageFormat s_emf =
new
(PInvokeCore.ImageFormatEMF);
20
private static readonly ImageFormat s_wmf =
new
(PInvokeCore.ImageFormatWMF);
21
private static readonly ImageFormat s_jpeg =
new
(PInvokeCore.ImageFormatJPEG);
22
private static readonly ImageFormat s_png =
new
(PInvokeCore.ImageFormatPNG);
23
private static readonly ImageFormat s_gif =
new
(PInvokeCore.ImageFormatGIF);
24
private static readonly ImageFormat s_tiff =
new
(PInvokeCore.ImageFormatTIFF);
25
private static readonly ImageFormat s_exif =
new
(PInvokeCore.ImageFormatEXIF);
26
private static readonly ImageFormat s_icon =
new
(PInvokeCore.ImageFormatIcon);
27
private static readonly ImageFormat s_heif =
new
(PInvokeCore.ImageFormatHEIF);
28
private static readonly ImageFormat s_webp =
new
(PInvokeCore.ImageFormatWEBP);
System.Drawing.Common.Tests (20)
System\Drawing\Imaging\ImageFormatTests.cs (20)
8
private static ImageFormat BmpImageFormat { get; } =
new
(new Guid("b96b3cab-0728-11d3-9d7b-0000f81ef32e"));
9
private static ImageFormat EmfImageFormat { get; } =
new
(new Guid("b96b3cac-0728-11d3-9d7b-0000f81ef32e"));
10
private static ImageFormat ExifImageFormat { get; } =
new
(new Guid("b96b3cb2-0728-11d3-9d7b-0000f81ef32e"));
11
private static ImageFormat GifImageFormat { get; } =
new
(new Guid("b96b3cb0-0728-11d3-9d7b-0000f81ef32e"));
12
private static ImageFormat TiffImageFormat { get; } =
new
(new Guid("b96b3cb1-0728-11d3-9d7b-0000f81ef32e"));
13
private static ImageFormat PngImageFormat { get; } =
new
(new Guid("b96b3caf-0728-11d3-9d7b-0000f81ef32e"));
14
private static ImageFormat MemoryBmpImageFormat { get; } =
new
(new Guid("b96b3caa-0728-11d3-9d7b-0000f81ef32e"));
15
private static ImageFormat IconImageFormat { get; } =
new
(new Guid("b96b3cb5-0728-11d3-9d7b-0000f81ef32e"));
16
private static ImageFormat JpegImageFormat { get; } =
new
(new Guid("b96b3cae-0728-11d3-9d7b-0000f81ef32e"));
17
private static ImageFormat WmfImageFormat { get; } =
new
(new Guid("b96b3cad-0728-11d3-9d7b-0000f81ef32e"));
18
private static ImageFormat HeifImageFormat { get; } =
new
(new Guid("{b96b3cb6-0728-11d3-9d7b-0000f81ef32e}"));
19
private static ImageFormat WebpImageFormat { get; } =
new
(new Guid("{b96b3cb7-0728-11d3-9d7b-0000f81ef32e}"));
20
private static ImageFormat CustomImageFormat { get; } =
new
(new Guid("48749428-316f-496a-ab30-c819a92b3137"));
85
yield return new object[] { new
ImageFormat
(new Guid("48749428-316f-496a-ab30-c819a92b3137")), new
ImageFormat
(new Guid("48749428-316f-496a-ab30-c819a92b3137")), true };
86
yield return new object[] { new
ImageFormat
(new Guid("48749428-316f-496a-ab30-c819a92b3137")), new
ImageFormat
(new Guid("b96b3cad-0728-11d3-9d7b-0000f81ef32e")), false };
87
yield return new object[] { new
ImageFormat
(new Guid("48749428-316f-496a-ab30-c819a92b3137")), null, false };
88
yield return new object[] { new
ImageFormat
(new Guid("48749428-316f-496a-ab30-c819a92b3137")), new(), false };
125
Assert.Equal(guid.GetHashCode(), new
ImageFormat
(guid).GetHashCode());
260 references to ImageFormat
PresentationFramework-SystemDrawing (1)
SystemDrawingExtension.cs (1)
92
metafile.Save(imageStream,
ImageFormat
.Png);
System.Drawing (1)
System.Drawing.cs (1)
90
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.Imaging.
ImageFormat
))]
System.Drawing.Common (86)
System\Drawing\Bitmap.cs (1)
231
if (RawFormat.Guid ==
ImageFormat
.Icon.Guid)
System\Drawing\Graphics.cs (1)
2645
if (errorStatus != Status.Ok && image.RawFormat.Equals(
ImageFormat
.Emf))
System\Drawing\Image.cs (4)
226
public void Save(string filename,
ImageFormat
format)
293
public void Save(Stream stream,
ImageFormat
format)
503
public
ImageFormat
RawFormat
872
if (!image.RawFormat.Equals(
ImageFormat
.Gif))
System\Drawing\ImageFormatConverter.cs (39)
48
return
ImageFormat
.Bmp;
50
return
ImageFormat
.Emf;
52
return
ImageFormat
.Exif;
54
return
ImageFormat
.Gif;
56
return
ImageFormat
.Icon;
58
return
ImageFormat
.Jpeg;
60
return
ImageFormat
.MemoryBmp;
62
return
ImageFormat
.Png;
64
return
ImageFormat
.Tiff;
66
return
ImageFormat
.Wmf;
68
return
ImageFormat
.Heif;
70
return
ImageFormat
.Webp;
72
throw new FormatException(SR.Format(SR.ConvertInvalidPrimitive, strFormat, nameof(
ImageFormat
)));
77
if (value is
ImageFormat
imgFormat)
87
if (imgFormat.Guid.Equals(
ImageFormat
.Bmp.Guid))
89
else if (imgFormat.Guid.Equals(
ImageFormat
.Emf.Guid))
91
else if (imgFormat.Guid.Equals(
ImageFormat
.Exif.Guid))
93
else if (imgFormat.Guid.Equals(
ImageFormat
.Gif.Guid))
95
else if (imgFormat.Guid.Equals(
ImageFormat
.Icon.Guid))
97
else if (imgFormat.Guid.Equals(
ImageFormat
.Jpeg.Guid))
99
else if (imgFormat.Guid.Equals(
ImageFormat
.MemoryBmp.Guid))
101
else if (imgFormat.Guid.Equals(
ImageFormat
.Png.Guid))
103
else if (imgFormat.Guid.Equals(
ImageFormat
.Tiff.Guid))
105
else if (imgFormat.Guid.Equals(
ImageFormat
.Wmf.Guid))
110
return new InstanceDescriptor(typeof(
ImageFormat
).GetProperty(strFormat), null);
114
ConstructorInfo? ctor = typeof(
ImageFormat
).GetConstructor([typeof(Guid)]);
125
return new StandardValuesCollection(new
ImageFormat
[]
127
ImageFormat
.MemoryBmp,
128
ImageFormat
.Bmp,
129
ImageFormat
.Emf,
130
ImageFormat
.Wmf,
131
ImageFormat
.Gif,
132
ImageFormat
.Jpeg,
133
ImageFormat
.Png,
134
ImageFormat
.Tiff,
135
ImageFormat
.Exif,
136
ImageFormat
.Icon,
137
ImageFormat
.Heif,
138
ImageFormat
.Webp
System\Drawing\Imaging\ImageFormat.cs (30)
17
private static readonly
ImageFormat
s_memoryBMP = new(PInvokeCore.ImageFormatMemoryBMP);
18
private static readonly
ImageFormat
s_bmp = new(PInvokeCore.ImageFormatBMP);
19
private static readonly
ImageFormat
s_emf = new(PInvokeCore.ImageFormatEMF);
20
private static readonly
ImageFormat
s_wmf = new(PInvokeCore.ImageFormatWMF);
21
private static readonly
ImageFormat
s_jpeg = new(PInvokeCore.ImageFormatJPEG);
22
private static readonly
ImageFormat
s_png = new(PInvokeCore.ImageFormatPNG);
23
private static readonly
ImageFormat
s_gif = new(PInvokeCore.ImageFormatGIF);
24
private static readonly
ImageFormat
s_tiff = new(PInvokeCore.ImageFormatTIFF);
25
private static readonly
ImageFormat
s_exif = new(PInvokeCore.ImageFormatEXIF);
26
private static readonly
ImageFormat
s_icon = new(PInvokeCore.ImageFormatIcon);
27
private static readonly
ImageFormat
s_heif = new(PInvokeCore.ImageFormatHEIF);
28
private static readonly
ImageFormat
s_webp = new(PInvokeCore.ImageFormatWEBP);
33
/// Initializes a new instance of the <see cref='
ImageFormat
'/> class with the specified GUID.
38
/// Specifies a global unique identifier (GUID) that represents this <see cref='
ImageFormat
'/>.
45
public static
ImageFormat
MemoryBmp => s_memoryBMP;
50
public static
ImageFormat
Bmp => s_bmp;
55
public static
ImageFormat
Emf => s_emf;
60
public static
ImageFormat
Wmf => s_wmf;
65
public static
ImageFormat
Gif => s_gif;
70
public static
ImageFormat
Jpeg => s_jpeg;
75
public static
ImageFormat
Png => s_png;
80
public static
ImageFormat
Tiff => s_tiff;
85
public static
ImageFormat
Exif => s_exif;
90
public static
ImageFormat
Icon => s_icon;
99
public static
ImageFormat
Heif => s_heif;
108
public static
ImageFormat
Webp => s_webp;
111
/// Returns a value indicating whether the specified object is an <see cref='
ImageFormat
'/> equivalent to this
112
/// <see cref='
ImageFormat
'/>.
114
public override bool Equals([NotNullWhen(true)] object? o) => o is
ImageFormat
format && _guid == format._guid;
127
/// Converts this <see cref='
ImageFormat
'/> to a human-readable string.
System\Drawing\Printing\PrinterSettings.cs (10)
330
public bool IsDirectPrintingSupported(
ImageFormat
imageFormat)
332
if (!imageFormat.Equals(
ImageFormat
.Jpeg) && !imageFormat.Equals(
ImageFormat
.Png))
341
private static bool IsDirectPrintingSupported(HDC hdc,
ImageFormat
imageFormat, out int escapeFunction)
343
Debug.Assert(imageFormat ==
ImageFormat
.Jpeg || imageFormat ==
ImageFormat
.Png);
345
escapeFunction = imageFormat.Equals(
ImageFormat
.Jpeg)
372
ImageFormat
imageFormat = image.RawFormat;
374
if (!imageFormat.Equals(
ImageFormat
.Jpeg) && !imageFormat.Equals(
ImageFormat
.Png))
System\Drawing\ToolboxBitmapAttribute.cs (1)
297
if (img.RawFormat.Guid ==
ImageFormat
.Icon.Guid)
System.Drawing.Common.Tests (149)
mono\System.Drawing.Imaging\BmpCodecTests.cs (1)
440
bmp.Save(sOutFile,
ImageFormat
.Bmp);
mono\System.Drawing.Imaging\GifCodecTests.cs (1)
194
bmp.Save(sOutFile,
ImageFormat
.Gif);
mono\System.Drawing.Imaging\IconCodecTests.cs (10)
43
Assert.True(image.RawFormat.Equals(
ImageFormat
.Icon));
49
Assert.True(bmp.RawFormat.Equals(
ImageFormat
.MemoryBmp));
72
Assert.True(bmp.RawFormat.Equals(
ImageFormat
.Icon));
221
Assert.True(bmp.RawFormat.Equals(
ImageFormat
.Icon));
426
Assert.True(bmp.RawFormat.Equals(
ImageFormat
.Icon));
648
Assert.True(bmp.RawFormat.Equals(
ImageFormat
.Icon));
906
Assert.True(bmp.RawFormat.Equals(
ImageFormat
.Icon));
1839
Assert.True(bmp.RawFormat.Equals(
ImageFormat
.Icon));
1880
bmp.Save(sOutFile,
ImageFormat
.Icon);
1884
Assert.Equal(
ImageFormat
.Png, bmpLoad.RawFormat);
mono\System.Drawing.Imaging\JpegCodecTests.cs (1)
359
bmp.Save(sOutFile,
ImageFormat
.Jpeg);
mono\System.Drawing.Imaging\PngCodecTests.cs (1)
580
bmp.Save(sOutFile,
ImageFormat
.Png);
mono\System.Drawing.Imaging\TiffCodecTests.cs (1)
251
bmp.Save(sOutFile,
ImageFormat
.Tiff);
mono\System.Drawing\BitmapTests.cs (8)
774
Assert.Equal(
ImageFormat
.MemoryBmp, bmp.RawFormat);
788
Assert.Equal(
ImageFormat
.Png, other.RawFormat);
1182
Assert.Equal(b.RawFormat,
ImageFormat
.MemoryBmp);
1270
Assert.Equal(bitmap.RawFormat,
ImageFormat
.Bmp);
1281
Assert.Equal(image.RawFormat,
ImageFormat
.MemoryBmp);
1296
Assert.Equal(bitmap.RawFormat,
ImageFormat
.Bmp);
1308
Assert.Equal(image.RawFormat,
ImageFormat
.MemoryBmp);
1317
Assert.Equal(image2.RawFormat,
ImageFormat
.MemoryBmp);
System\Drawing\BitmapTests.cs (24)
36
yield return new object[] { "16x16_one_entry_4bit.ico", 16, 16, PixelFormat.Format32bppArgb,
ImageFormat
.Icon };
37
yield return new object[] { "bitmap_173x183_indexed_8bit.bmp", 173, 183, PixelFormat.Format8bppIndexed,
ImageFormat
.Bmp };
38
yield return new object[] { "16x16_nonindexed_24bit.png", 16, 16, PixelFormat.Format24bppRgb,
ImageFormat
.Png };
43
public void Ctor_FilePath(string filename, int width, int height, PixelFormat pixelFormat,
ImageFormat
rawFormat)
54
public void Ctor_FilePath_UseIcm(string filename, int width, int height, PixelFormat pixelFormat,
ImageFormat
rawFormat)
91
Assert.Equal(
ImageFormat
.Bmp, bitmap.RawFormat);
118
public void Ctor_Stream(string filename, int width, int height, PixelFormat pixelFormat,
ImageFormat
rawFormat)
130
public void Ctor_Stream_UseIcm(string filename, int width, int height, PixelFormat pixelFormat,
ImageFormat
rawFormat)
168
Assert.Equal(
ImageFormat
.MemoryBmp, bitmap.RawFormat);
192
Assert.Equal(
ImageFormat
.MemoryBmp, bitmap.RawFormat);
211
Assert.Equal(
ImageFormat
.MemoryBmp, bitmap.RawFormat);
291
Assert.Equal(
ImageFormat
.MemoryBmp, bitmap.RawFormat);
308
Assert.Equal(
ImageFormat
.MemoryBmp, bitmap.RawFormat);
325
Assert.Equal(
ImageFormat
.MemoryBmp, bitmap.RawFormat);
336
Assert.Equal(
ImageFormat
.MemoryBmp, bitmap.RawFormat);
607
Assert.Equal(
ImageFormat
.MemoryBmp, result.RawFormat);
620
Assert.Equal(
ImageFormat
.MemoryBmp, result.RawFormat);
629
Assert.Equal(
ImageFormat
.MemoryBmp, result.RawFormat);
704
Assert.Equal(
ImageFormat
.MemoryBmp, result.RawFormat);
742
bitmapFromWmf.Save(output,
ImageFormat
.Png);
1569
bitmap.Save(path,
ImageFormat
.Png);
1577
Assert.Equal(
ImageFormat
.Png, bitmap.RawFormat);
1591
bitmap.Save(restrictiveStream,
ImageFormat
.Png);
1600
Assert.Equal(
ImageFormat
.Png, bitmap.RawFormat);
System\Drawing\IconTests.cs (3)
530
Assert.Equal(
ImageFormat
.MemoryBmp, bitmap.RawFormat);
568
Assert.Equal(
ImageFormat
.Png, bitmap.RawFormat);
619
bitmap.Save(stream,
ImageFormat
.Png);
System\Drawing\ImageAnimator.ManualTests.cs (1)
60
animation.Save(Path.Join(testOutputFolder, $"{++frameIndexes[imageName]}_{timestamp}.jpg"),
ImageFormat
.Jpeg);
System\Drawing\ImageFormatConverterTests.cs (32)
12
private readonly
ImageFormat
_imageFmt;
19
_imageFmt =
ImageFormat
.Bmp;
31
Assert.False(_imgFmtConv.CanConvertFrom(null, typeof(
ImageFormat
)), "ImageFormat");
38
Assert.False(_imgFmtConvFrmTD.CanConvertFrom(null, typeof(
ImageFormat
)), "TD ImageFormat");
49
Assert.False(_imgFmtConv.CanConvertTo(null, typeof(
ImageFormat
)), "ImageFormat");
56
Assert.False(_imgFmtConvFrmTD.CanConvertTo(null, typeof(
ImageFormat
)), "TD ImageFormat");
65
Assert.Equal(_imageFmt, (
ImageFormat
)_imgFmtConv.ConvertFrom(null, CultureInfo.InvariantCulture,
ImageFormat
.Bmp.ToString()));
66
Assert.Equal(_imageFmt, (
ImageFormat
)_imgFmtConvFrmTD.ConvertFrom(null, CultureInfo.InvariantCulture,
ImageFormat
.Bmp.ToString()));
72
Assert.Throws<NotSupportedException>(() => _imgFmtConv.ConvertFrom(null, CultureInfo.InvariantCulture,
ImageFormat
.Bmp));
73
Assert.Throws<NotSupportedException>(() => _imgFmtConv.ConvertFrom(null, CultureInfo.InvariantCulture,
ImageFormat
.Bmp.Guid));
77
Assert.Throws<NotSupportedException>(() => _imgFmtConvFrmTD.ConvertFrom(null, CultureInfo.InvariantCulture,
ImageFormat
.Bmp));
78
Assert.Throws<NotSupportedException>(() => _imgFmtConvFrmTD.ConvertFrom(null, CultureInfo.InvariantCulture,
ImageFormat
.Bmp.Guid));
83
private
ImageFormat
ConvertFromName(string imgFormatName)
85
return (
ImageFormat
)_imgFmtConvFrmTD.ConvertFrom(null, CultureInfo.InvariantCulture, imgFormatName);
91
Assert.Equal(
ImageFormat
.Bmp, ConvertFromName("Bmp"));
92
Assert.Equal(
ImageFormat
.Emf, ConvertFromName("Emf"));
93
Assert.Equal(
ImageFormat
.Exif, ConvertFromName("Exif"));
94
Assert.Equal(
ImageFormat
.Gif, ConvertFromName("Gif"));
95
Assert.Equal(
ImageFormat
.Tiff, ConvertFromName("Tiff"));
96
Assert.Equal(
ImageFormat
.Png, ConvertFromName("Png"));
97
Assert.Equal(
ImageFormat
.MemoryBmp, ConvertFromName("MemoryBmp"));
98
Assert.Equal(
ImageFormat
.Icon, ConvertFromName("Icon"));
99
Assert.Equal(
ImageFormat
.Jpeg, ConvertFromName("Jpeg"));
100
Assert.Equal(
ImageFormat
.Wmf, ConvertFromName("Wmf"));
102
Assert.Equal(
ImageFormat
.Heif, ConvertFromName("Heif"));
103
Assert.Equal(
ImageFormat
.Webp, ConvertFromName("Webp"));
111
ImageFormat
imageformat = ConvertFromName($"[ImageFormat: {testGuid}]");
146
Assert.Throws<NotSupportedException>(() => _imgFmtConv.ConvertTo(null, CultureInfo.InvariantCulture, _imageFmt, typeof(
ImageFormat
)));
151
Assert.Throws<NotSupportedException>(() => _imgFmtConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _imageFmt, typeof(
ImageFormat
)));
181
foreach (
ImageFormat
iformat in values)
System\Drawing\ImageTests.cs (3)
614
ImageFormat
.Tiff,
629
ImageFormat
.Jpeg,
644
public void GetEncoderParameterList_ReturnsExpected(
ImageFormat
format, Guid[] expectedParameters)
System\Drawing\Imaging\ImageCodecInfoTests.cs (11)
72
private void CheckDecoderAndEncoder(string clsid,
ImageFormat
format, string CodecName, string DllName,
90
private static void CheckImageCodecInfo(
ImageFormat
format, string CodecName, string DllName, string FilenameExtension, ImageCodecFlags Flags, string FormatDescription, string MimeType, int signatureLength, string mask, string pattern, string pattern2, ImageCodecInfo codecInfo)
122
WMF_CSID,
ImageFormat
.Wmf,
130
EMF_CSID,
ImageFormat
.Emf,
139
ICO_CSID,
ImageFormat
.Icon,
147
TIF_CSID,
ImageFormat
.Tiff,
155
PNG_CSID,
ImageFormat
.Png,
163
JPG_JPEG_JPE_JFIF_CSID,
ImageFormat
.Jpeg,
171
GIF_CSID,
ImageFormat
.Gif,
179
BMP_DIB_RLE_CSID,
ImageFormat
.Bmp,
226
public void CheckDecoderAndEncoder_ReturnsExpected(string clsid,
ImageFormat
format, string codecName, string dllName,
System\Drawing\Imaging\ImageFormatTests.cs (40)
8
private static
ImageFormat
BmpImageFormat { get; } = new(new Guid("b96b3cab-0728-11d3-9d7b-0000f81ef32e"));
9
private static
ImageFormat
EmfImageFormat { get; } = new(new Guid("b96b3cac-0728-11d3-9d7b-0000f81ef32e"));
10
private static
ImageFormat
ExifImageFormat { get; } = new(new Guid("b96b3cb2-0728-11d3-9d7b-0000f81ef32e"));
11
private static
ImageFormat
GifImageFormat { get; } = new(new Guid("b96b3cb0-0728-11d3-9d7b-0000f81ef32e"));
12
private static
ImageFormat
TiffImageFormat { get; } = new(new Guid("b96b3cb1-0728-11d3-9d7b-0000f81ef32e"));
13
private static
ImageFormat
PngImageFormat { get; } = new(new Guid("b96b3caf-0728-11d3-9d7b-0000f81ef32e"));
14
private static
ImageFormat
MemoryBmpImageFormat { get; } = new(new Guid("b96b3caa-0728-11d3-9d7b-0000f81ef32e"));
15
private static
ImageFormat
IconImageFormat { get; } = new(new Guid("b96b3cb5-0728-11d3-9d7b-0000f81ef32e"));
16
private static
ImageFormat
JpegImageFormat { get; } = new(new Guid("b96b3cae-0728-11d3-9d7b-0000f81ef32e"));
17
private static
ImageFormat
WmfImageFormat { get; } = new(new Guid("b96b3cad-0728-11d3-9d7b-0000f81ef32e"));
18
private static
ImageFormat
HeifImageFormat { get; } = new(new Guid("{b96b3cb6-0728-11d3-9d7b-0000f81ef32e}"));
19
private static
ImageFormat
WebpImageFormat { get; } = new(new Guid("{b96b3cb7-0728-11d3-9d7b-0000f81ef32e}"));
20
private static
ImageFormat
CustomImageFormat { get; } = new(new Guid("48749428-316f-496a-ab30-c819a92b3137"));
26
yield return new object[] { BmpImageFormat.Guid,
ImageFormat
.Bmp };
27
yield return new object[] { EmfImageFormat.Guid,
ImageFormat
.Emf };
28
yield return new object[] { ExifImageFormat.Guid,
ImageFormat
.Exif };
29
yield return new object[] { GifImageFormat.Guid,
ImageFormat
.Gif };
30
yield return new object[] { TiffImageFormat.Guid,
ImageFormat
.Tiff };
31
yield return new object[] { PngImageFormat.Guid,
ImageFormat
.Png };
32
yield return new object[] { MemoryBmpImageFormat.Guid,
ImageFormat
.MemoryBmp };
33
yield return new object[] { IconImageFormat.Guid,
ImageFormat
.Icon };
34
yield return new object[] { JpegImageFormat.Guid,
ImageFormat
.Jpeg };
35
yield return new object[] { WmfImageFormat.Guid,
ImageFormat
.Wmf };
38
yield return new object[] { HeifImageFormat.Guid,
ImageFormat
.Heif };
39
yield return new object[] { WebpImageFormat.Guid,
ImageFormat
.Webp };
50
yield return new object[] { "Bmp",
ImageFormat
.Bmp };
51
yield return new object[] { "Emf",
ImageFormat
.Emf };
52
yield return new object[] { "Exif",
ImageFormat
.Exif };
53
yield return new object[] { "Gif",
ImageFormat
.Gif };
54
yield return new object[] { "Tiff",
ImageFormat
.Tiff };
55
yield return new object[] { "Png",
ImageFormat
.Png };
56
yield return new object[] { "MemoryBMP",
ImageFormat
.MemoryBmp };
57
yield return new object[] { "Icon",
ImageFormat
.Icon };
58
yield return new object[] { "Jpeg",
ImageFormat
.Jpeg };
59
yield return new object[] { "Wmf",
ImageFormat
.Wmf };
62
yield return new object[] { "Heif",
ImageFormat
.Heif };
63
yield return new object[] { "Webp",
ImageFormat
.Webp };
94
public void Guid_ReturnsExpected(Guid expectedGuid,
ImageFormat
imageFormat)
101
public void ToString_ReturnsExpected(string expected,
ImageFormat
imageFormat)
116
public void Equals_Object_ReturnsExpected(
ImageFormat
imageFormat, object obj, bool result)
System\Drawing\Printing\PrinterSettingsTests.cs (12)
374
yield return new object[] {
ImageFormat
.Jpeg };
375
yield return new object[] {
ImageFormat
.Png };
380
public void IsDirectPrintingSupported_ImageFormatSupported_ReturnsExpected(
ImageFormat
imageFormat)
388
yield return new object[] {
ImageFormat
.Emf };
389
yield return new object[] {
ImageFormat
.Exif };
390
yield return new object[] {
ImageFormat
.Gif };
391
yield return new object[] {
ImageFormat
.Icon };
392
yield return new object[] {
ImageFormat
.MemoryBmp };
393
yield return new object[] {
ImageFormat
.Tiff };
394
yield return new object[] {
ImageFormat
.Wmf };
395
yield return new object[] {
ImageFormat
.Bmp };
400
public void IsDirectPrintingSupported_ImageFormatNotSupported_ReturnsExpected(
ImageFormat
imageFormat)
System.Windows.Forms (6)
System\Windows\Forms\Controls\ImageList\ImageList.cs (1)
691
if (result.RawFormat.Guid !=
ImageFormat
.Icon.Guid)
System\Windows\Forms\Controls\ImageList\ImageList.ImageCollection.cs (1)
147
if (_owner.UseTransparentColor && bitmap.RawFormat.Guid !=
ImageFormat
.Icon.Guid)
System\Windows\Forms\Controls\ListView\ListView.cs (1)
5126
BackgroundImage.Save(_backgroundImageFileName, Drawing.Imaging.
ImageFormat
.Bmp);
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (1)
1310
if (image.RawFormat.Guid !=
ImageFormat
.Icon.Guid)
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (2)
1054
if (bmp.RawFormat.Guid !=
ImageFormat
.Icon.Guid && !ImageAnimator.CanAnimate(bmp))
1091
if (currentImage.RawFormat.Guid !=
ImageFormat
.Icon.Guid && !ImageAnimator.CanAnimate(currentImage))
System.Windows.Forms.Design (1)
System\Windows\Forms\Design\ImageListImage.cs (1)
44
public
ImageFormat
RawFormat => Image.RawFormat;
System.Windows.Forms.Design.Tests (10)
System\Drawing\Design\BitmapEditorTests.cs (2)
76
image.Save(stream,
ImageFormat
.Bmp);
82
result.Save(resultStream,
ImageFormat
.Bmp);
System\Drawing\Design\ImageEditorTests.cs (2)
133
image.Save(stream,
ImageFormat
.Bmp);
139
result.Save(resultStream,
ImageFormat
.Bmp);
System\Drawing\Design\MetafileEditorTests.cs (1)
60
image.Save(stream,
ImageFormat
.Bmp);
System\Windows\Forms\Design\ImageListImageEditorTests.cs (2)
21
image.Save(stream,
ImageFormat
.Bmp);
30
result.Image.Save(resultStream,
ImageFormat
.Bmp);
System\Windows\Forms\Design\ImageListImageTests.cs (3)
61
bitmap.Save(memoryStream, Drawing.Imaging.
ImageFormat
.Bmp);
69
result.Image.RawFormat.Should().Be(expected: Drawing.Imaging.
ImageFormat
.Bmp);
85
result.Image.RawFormat.Should().Be(Drawing.Imaging.
ImageFormat
.MemoryBmp);
System.Windows.Forms.Tests (1)
System\Windows\Forms\RichTextBoxTests.ClipboardTests.cs (1)
24
bitmap.Save(memoryStream, Drawing.Imaging.
ImageFormat
.Png);
System.Windows.Forms.UI.IntegrationTests (2)
Infra\ScreenRecordService.cs (1)
411
frame.Save(stream,
ImageFormat
.Png);
Infra\ScreenshotService.cs (1)
36
bitmap.Save(fullPath,
ImageFormat
.Png);
WindowsFormsIntegration (3)
System\Windows\Integration\Convert.cs (3)
147
SDI.
ImageFormat
IntermediateFormat = fromImage.RawFormat;
148
if (IntermediateFormat.Guid.CompareTo(SDI.
ImageFormat
.MemoryBmp.Guid) == 0)
150
IntermediateFormat = SDI.
ImageFormat
.Bmp;