843 references to PixelFormat
PresentationFramework-SystemDrawing (2)
SystemDrawingExtension.cs (2)
166
System.Drawing.Imaging.
PixelFormat
.Format32bppRgb);
171
System.Drawing.Imaging.
PixelFormat
.Format32bppRgb);
System.Drawing (1)
System.Drawing.cs (1)
98
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.Imaging.
PixelFormat
))]
System.Drawing.Common.Tests (580)
mono\System.Drawing.Imaging\BmpCodecTests.cs (16)
48
Assert.Equal(
PixelFormat
.Format4bppIndexed, bmp.PixelFormat);
114
Assert.Equal(
PixelFormat
.Format8bppIndexed, bmp.PixelFormat);
180
Assert.Equal(
PixelFormat
.Format24bppRgb, bmp.PixelFormat);
242
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly,
PixelFormat
.Format24bppRgb);
247
Assert.Equal(
PixelFormat
.Format24bppRgb, data.PixelFormat);
384
Assert.Equal(
PixelFormat
.Format32bppRgb, bmp.PixelFormat);
424
private static void Save(
PixelFormat
original,
PixelFormat
expected, bool colorCheck)
468
Save(
PixelFormat
.Format24bppRgb,
PixelFormat
.Format24bppRgb, true);
474
Save(
PixelFormat
.Format32bppRgb,
PixelFormat
.Format32bppRgb, true);
480
Save(
PixelFormat
.Format32bppArgb,
PixelFormat
.Format32bppRgb, true);
486
Save(
PixelFormat
.Format32bppPArgb,
PixelFormat
.Format32bppRgb, true);
mono\System.Drawing.Imaging\GifCodecTests.cs (13)
45
Assert.Equal(
PixelFormat
.Format8bppIndexed, bmp.PixelFormat);
109
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly,
PixelFormat
.Format24bppRgb);
114
Assert.Equal(
PixelFormat
.Format24bppRgb, data.PixelFormat);
178
private static void Save(
PixelFormat
original,
PixelFormat
expected, bool exactColorCheck)
232
Save(
PixelFormat
.Format24bppRgb,
PixelFormat
.Format8bppIndexed, false);
238
Save(
PixelFormat
.Format32bppRgb,
PixelFormat
.Format8bppIndexed, false);
244
Save(
PixelFormat
.Format32bppArgb,
PixelFormat
.Format8bppIndexed, false);
250
Save(
PixelFormat
.Format32bppPArgb,
PixelFormat
.Format8bppIndexed, false);
mono\System.Drawing.Imaging\IconCodecTests.cs (28)
45
Assert.Equal(
PixelFormat
.Format32bppArgb, image.PixelFormat);
50
Assert.Equal(
PixelFormat
.Format32bppArgb, bmp.PixelFormat);
74
Assert.Equal(
PixelFormat
.Format32bppArgb, bmp.PixelFormat);
132
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly,
PixelFormat
.Format24bppRgb);
137
Assert.Equal(
PixelFormat
.Format24bppRgb, data.PixelFormat);
222
Assert.Equal(
PixelFormat
.Format32bppArgb, bmp.PixelFormat);
328
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly,
PixelFormat
.Format24bppRgb);
333
Assert.Equal(
PixelFormat
.Format24bppRgb, data.PixelFormat);
427
Assert.Equal(
PixelFormat
.Format32bppArgb, bmp.PixelFormat);
546
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly,
PixelFormat
.Format24bppRgb);
551
Assert.Equal(
PixelFormat
.Format24bppRgb, data.PixelFormat);
649
Assert.Equal(
PixelFormat
.Format32bppArgb, bmp.PixelFormat);
750
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly,
PixelFormat
.Format24bppRgb);
755
Assert.Equal(
PixelFormat
.Format24bppRgb, data.PixelFormat);
907
Assert.Equal(
PixelFormat
.Format32bppArgb, bmp.PixelFormat);
1525
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly,
PixelFormat
.Format24bppRgb);
1530
Assert.Equal(
PixelFormat
.Format24bppRgb, data.PixelFormat);
1841
Assert.Equal(
PixelFormat
.Format32bppArgb, bmp.PixelFormat);
1862
private static void Save(
PixelFormat
original,
PixelFormat
expected, bool colorCheck)
1909
Save(
PixelFormat
.Format24bppRgb,
PixelFormat
.Format24bppRgb, true);
1915
Save(
PixelFormat
.Format32bppRgb,
PixelFormat
.Format32bppArgb, true);
1921
Save(
PixelFormat
.Format32bppArgb,
PixelFormat
.Format32bppArgb, true);
1927
Save(
PixelFormat
.Format32bppPArgb,
PixelFormat
.Format32bppArgb, true);
mono\System.Drawing.Imaging\JpegCodecTests.cs (16)
47
Assert.Equal(
PixelFormat
.Format8bppIndexed, bmp.PixelFormat);
112
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly,
PixelFormat
.Format24bppRgb);
117
Assert.Equal(
PixelFormat
.Format24bppRgb, data.PixelFormat);
174
Assert.Equal(
PixelFormat
.Format24bppRgb, bmp.PixelFormat);
227
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly,
PixelFormat
.Format24bppRgb);
232
Assert.Equal(
PixelFormat
.Format24bppRgb, data.PixelFormat);
343
private static void Save(
PixelFormat
original,
PixelFormat
expected)
388
Save(
PixelFormat
.Format24bppRgb,
PixelFormat
.Format24bppRgb);
394
Save(
PixelFormat
.Format32bppRgb,
PixelFormat
.Format24bppRgb);
400
Save(
PixelFormat
.Format32bppArgb,
PixelFormat
.Format24bppRgb);
406
Save(
PixelFormat
.Format32bppPArgb,
PixelFormat
.Format24bppRgb);
mono\System.Drawing.Imaging\PngCodecTests.cs (19)
47
Assert.Equal(
PixelFormat
.Format1bppIndexed, bmp.PixelFormat);
145
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly,
PixelFormat
.Format24bppRgb);
150
Assert.Equal(
PixelFormat
.Format24bppRgb, data.PixelFormat);
250
Assert.Equal(
PixelFormat
.Format32bppArgb, bmp.PixelFormat);
297
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly,
PixelFormat
.Format24bppRgb);
302
Assert.Equal(
PixelFormat
.Format24bppRgb, data.PixelFormat);
357
Assert.Equal(
PixelFormat
.Format4bppIndexed, bmp.PixelFormat);
470
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly,
PixelFormat
.Format24bppRgb);
475
Assert.Equal(
PixelFormat
.Format24bppRgb, data.PixelFormat);
564
private static void Save(
PixelFormat
original,
PixelFormat
expected, bool colorCheck)
608
Save(
PixelFormat
.Format24bppRgb,
PixelFormat
.Format24bppRgb, true);
614
Save(
PixelFormat
.Format32bppRgb,
PixelFormat
.Format32bppArgb, true);
620
Save(
PixelFormat
.Format32bppArgb,
PixelFormat
.Format32bppArgb, true);
626
Save(
PixelFormat
.Format32bppPArgb,
PixelFormat
.Format32bppArgb, true);
mono\System.Drawing.Imaging\TiffCodecTests.cs (13)
67
Assert.Equal(
PixelFormat
.Format24bppRgb, bmp.PixelFormat);
119
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly,
PixelFormat
.Format24bppRgb);
124
Assert.Equal(
PixelFormat
.Format24bppRgb, data.PixelFormat);
235
private static void Save(
PixelFormat
original,
PixelFormat
expected, bool colorCheck)
279
Save(
PixelFormat
.Format24bppRgb,
PixelFormat
.Format24bppRgb, true);
285
Save(
PixelFormat
.Format32bppRgb,
PixelFormat
.Format32bppArgb, true);
291
Save(
PixelFormat
.Format32bppArgb,
PixelFormat
.Format32bppArgb, true);
297
Save(
PixelFormat
.Format32bppPArgb,
PixelFormat
.Format32bppArgb, true);
mono\System.Drawing\BitmapTests.cs (64)
48
Bitmap bmp = new(100, 100,
PixelFormat
.Format32bppRgb);
62
using Bitmap bmp = new(100, 100,
PixelFormat
.Format8bppIndexed);
64
BitmapData bd = bmp.LockBits(rect, ImageLockMode.ReadWrite,
PixelFormat
.Format24bppRgb);
71
using Bitmap bmp = new(100, 100,
PixelFormat
.Format32bppRgb);
74
bd = bmp.LockBits(rect, ImageLockMode.ReadWrite,
PixelFormat
.Format8bppIndexed, bd);
89
using Bitmap bmp = new(10, 10,
PixelFormat
.Format24bppRgb);
91
BitmapData data = bmp.LockBits(r, 0,
PixelFormat
.Format24bppRgb);
97
Assert.Equal(
PixelFormat
.Format24bppRgb, data.PixelFormat);
109
using Bitmap bmp = new(10, 10,
PixelFormat
.Format24bppRgb);
111
BitmapData data = bmp.LockBits(r, ImageLockMode.ReadOnly,
PixelFormat
.Format24bppRgb);
114
Assert.Throws<InvalidOperationException>(() => bmp.LockBits(r, ImageLockMode.ReadOnly,
PixelFormat
.Format24bppRgb));
125
using Bitmap bmp = new(1, 1,
PixelFormat
.Format1bppIndexed);
134
using Bitmap bmp = new(1, 1,
PixelFormat
.Format4bppIndexed);
143
using Bitmap bmp = new(1, 1,
PixelFormat
.Format8bppIndexed);
149
private static void FormatTest(
PixelFormat
format)
164
if (format ==
PixelFormat
.Format16bppRgb565)
177
if (format ==
PixelFormat
.Format16bppRgb565)
190
if (format ==
PixelFormat
.Format32bppPArgb)
221
if (format ==
PixelFormat
.Format32bppPArgb)
237
case
PixelFormat
.Format16bppRgb565:
243
case
PixelFormat
.Format16bppArgb1555:
249
case
PixelFormat
.Format16bppRgb555:
263
if (format !=
PixelFormat
.Format32bppRgb)
282
public void Format32bppArgb() => FormatTest(
PixelFormat
.Format32bppArgb);
285
public void Format32bppRgb() => FormatTest(
PixelFormat
.Format32bppRgb);
288
public void Format24bppRgb() => FormatTest(
PixelFormat
.Format24bppRgb);
321
using Bitmap bmpNew = bmp.Clone(rect,
PixelFormat
.Format32bppArgb);
375
using Bitmap bmp_rotate = src.Clone(new RectangleF(0, 0, width, height),
PixelFormat
.Format32bppArgb);
397
PixelFormat
.Format1bppIndexed => 8,
398
PixelFormat
.Format4bppIndexed => 2,
399
PixelFormat
.Format8bppIndexed => 1,
454
private static Bitmap CreateBitmap(int width, int height,
PixelFormat
fmt)
500
private static byte[] HashLock(Bitmap bmp, int width, int height,
PixelFormat
fmt, ImageLockMode mode)
557
using Bitmap bmp = CreateBitmap(100, 100,
PixelFormat
.Format32bppArgb);
562
byte[] actual = HashLock(bmp, bmp.Width, bmp.Height,
PixelFormat
.Format32bppArgb, ImageLockMode.ReadWrite);
571
using Bitmap bmp = CreateBitmap(100, 100,
PixelFormat
.Format32bppArgb);
575
byte[] actual = HashLock(bmp, bmp.Width, bmp.Height,
PixelFormat
.Format32bppPArgb, ImageLockMode.ReadWrite);
584
using Bitmap bmp = CreateBitmap(100, 100,
PixelFormat
.Format32bppArgb);
588
byte[] actual = HashLock(bmp, bmp.Width, bmp.Height,
PixelFormat
.Format32bppRgb, ImageLockMode.ReadWrite);
597
using Bitmap bmp = CreateBitmap(100, 100,
PixelFormat
.Format32bppArgb);
601
byte[] actual = HashLock(bmp, bmp.Width, bmp.Height,
PixelFormat
.Format24bppRgb, ImageLockMode.ReadWrite);
613
using Bitmap bmp = CreateBitmap(100, 100,
PixelFormat
.Format32bppArgb);
617
byte[] actual = HashLock(bmp, 50, 50,
PixelFormat
.Format32bppArgb, ImageLockMode.ReadWrite);
626
using Bitmap bmp = CreateBitmap(100, 100,
PixelFormat
.Format32bppArgb);
630
byte[] actual = HashLock(bmp, 50, 50,
PixelFormat
.Format32bppPArgb, ImageLockMode.ReadWrite);
639
using Bitmap bmp = CreateBitmap(100, 100,
PixelFormat
.Format32bppArgb);
643
byte[] actual = HashLock(bmp, 50, 50,
PixelFormat
.Format32bppRgb, ImageLockMode.ReadWrite);
652
using Bitmap bmp = CreateBitmap(100, 100,
PixelFormat
.Format32bppArgb);
656
byte[] actual = HashLock(bmp, 50, 50,
PixelFormat
.Format24bppRgb, ImageLockMode.ReadWrite);
674
using (Bitmap bmp = new(1, 1,
PixelFormat
.Format32bppRgb))
680
data = bmp.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly,
PixelFormat
.Format32bppArgb);
709
data = bmp.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadWrite,
PixelFormat
.Format32bppArgb);
729
using (Bitmap bmp = new(1, 1,
PixelFormat
.Format32bppArgb))
733
data = bmp.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly,
PixelFormat
.Format24bppRgb);
753
data = bmp.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadWrite,
PixelFormat
.Format24bppRgb);
797
Bitmap bmp = new(184, 184,
PixelFormat
.Format1bppIndexed);
798
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadWrite,
PixelFormat
.Format1bppIndexed);
819
using Bitmap bmp = new(1, 1,
PixelFormat
.Format1bppIndexed);
853
using Bitmap bmp = new(1, 1,
PixelFormat
.Format4bppIndexed);
1127
using Bitmap bmp = new(1, 1,
PixelFormat
.Format8bppIndexed);
1169
public void BitmapIntIntIntPixelFormatIntPtrCtor() => new Bitmap(1, 1, 1,
PixelFormat
.Format1bppIndexed, nint.Zero);
1176
b.PixelFormat.Should().Be(
PixelFormat
.Format32bppArgb, msg);
1265
Assert.Equal(
PixelFormat
.Format24bppRgb, bitmap.PixelFormat);
1291
Assert.Equal(
PixelFormat
.Format24bppRgb, bitmap.PixelFormat);
mono\System.Drawing\GraphicsTests.cs (1)
347
Assert.Equal(
PixelFormat
.Format4bppIndexed, img.PixelFormat);
mono\System.Imaging\MetafileTest.cs (5)
216
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
233
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
249
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
289
using (Bitmap bmp = new(100, 100,
PixelFormat
.Format32bppArgb))
331
using Bitmap bmp = new(100, 100,
PixelFormat
.Format32bppArgb);
System\Drawing\BitmapTests.cs (264)
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)
90
Assert.Equal(
PixelFormat
.Format8bppIndexed, bitmap.PixelFormat);
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)
167
Assert.Equal(
PixelFormat
.Format32bppArgb, bitmap.PixelFormat);
172
[InlineData(10, 10,
PixelFormat
.Format1bppIndexed)]
173
[InlineData(10, 10,
PixelFormat
.Format8bppIndexed)]
174
[InlineData(1, 1,
PixelFormat
.Format16bppArgb1555)]
175
[InlineData(1, 1,
PixelFormat
.Format16bppRgb555)]
176
[InlineData(1, 1,
PixelFormat
.Format16bppRgb565)]
177
[InlineData(1, 1,
PixelFormat
.Format16bppGrayScale)]
178
[InlineData(1, 1,
PixelFormat
.Format24bppRgb)]
179
[InlineData(1, 1,
PixelFormat
.Format32bppRgb)]
180
[InlineData(5, 15,
PixelFormat
.Format32bppArgb)]
181
[InlineData(1, 1,
PixelFormat
.Format32bppPArgb)]
182
[InlineData(10, 10,
PixelFormat
.Format48bppRgb)]
183
[InlineData(10, 10,
PixelFormat
.Format4bppIndexed)]
184
[InlineData(1, 1,
PixelFormat
.Format64bppArgb)]
185
[InlineData(1, 1,
PixelFormat
.Format64bppPArgb)]
186
public void Ctor_Width_Height_PixelFormat(int width, int height,
PixelFormat
pixelFormat)
197
yield return new object[] { 10, 10, 0,
PixelFormat
.Format8bppIndexed, IntPtr.Zero };
198
yield return new object[] { 5, 15, int.MaxValue,
PixelFormat
.Format32bppArgb, IntPtr.Zero };
199
yield return new object[] { 5, 15, int.MinValue,
PixelFormat
.Format24bppRgb, IntPtr.Zero };
200
yield return new object[] { 1, 1, 1,
PixelFormat
.Format1bppIndexed, IntPtr.Zero };
205
public void Ctor_Width_Height_Stride_PixelFormat_Scan0(int width, int height, int stride,
PixelFormat
pixelFormat, IntPtr scan0)
225
AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(width, 1,
PixelFormat
.Format16bppArgb1555));
226
AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(width, 1, 0,
PixelFormat
.Format16bppArgb1555, IntPtr.Zero));
240
AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(1, height,
PixelFormat
.Format16bppArgb1555));
241
AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(1, height, 0,
PixelFormat
.Format16bppArgb1555, IntPtr.Zero));
245
[InlineData(
PixelFormat
.Undefined - 1)]
246
[InlineData(
PixelFormat
.Undefined)]
247
[InlineData(
PixelFormat
.Gdi - 1)]
248
[InlineData(
PixelFormat
.Max)]
249
[InlineData(
PixelFormat
.Indexed)]
250
[InlineData(
PixelFormat
.Gdi)]
251
[InlineData(
PixelFormat
.Alpha)]
252
[InlineData(
PixelFormat
.PAlpha)]
253
[InlineData(
PixelFormat
.Extended)]
254
[InlineData(
PixelFormat
.Canonical)]
255
public void Ctor_InvalidPixelFormat_ThrowsArgumentException(
PixelFormat
format)
264
AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(1, 1, 0,
PixelFormat
.Format16bppArgb1555, 10));
269
yield return new object[] { new Bitmap(1, 1,
PixelFormat
.Format16bppRgb555), 1, 1 };
270
yield return new object[] { new Bitmap(1, 1,
PixelFormat
.Format16bppRgb565), 1, 1 };
271
yield return new object[] { new Bitmap(1, 1,
PixelFormat
.Format24bppRgb), 1, 1 };
272
yield return new object[] { new Bitmap(1, 1,
PixelFormat
.Format32bppArgb), 1, 1 };
273
yield return new object[] { new Bitmap(1, 1,
PixelFormat
.Format32bppPArgb), 1, 1 };
274
yield return new object[] { new Bitmap(1, 1,
PixelFormat
.Format48bppRgb), 1, 1 };
275
yield return new object[] { new Bitmap(1, 1,
PixelFormat
.Format64bppArgb), 1, 1 };
276
yield return new object[] { new Bitmap(1, 1,
PixelFormat
.Format64bppPArgb), 1, 1 };
290
Assert.Equal(
PixelFormat
.Format32bppPArgb, bitmap.PixelFormat);
307
Assert.Equal(
PixelFormat
.Format32bppArgb, bitmap.PixelFormat);
324
Assert.Equal(
PixelFormat
.Format32bppArgb, bitmap.PixelFormat);
335
Assert.Equal(
PixelFormat
.Format32bppArgb, bitmap.PixelFormat);
359
yield return new object[] { new Bitmap(3, 3,
PixelFormat
.Format32bppArgb), new Rectangle(0, 0, 3, 3),
PixelFormat
.Format32bppArgb };
360
yield return new object[] { new Bitmap(3, 3,
PixelFormat
.Format32bppArgb), new Rectangle(0, 0, 3, 3),
PixelFormat
.Format24bppRgb };
361
yield return new object[] { new Bitmap(3, 3,
PixelFormat
.Format1bppIndexed), new Rectangle(1, 1, 1, 1),
PixelFormat
.Format64bppArgb };
362
yield return new object[] { new Bitmap(3, 3,
PixelFormat
.Format64bppPArgb), new Rectangle(1, 1, 1, 1),
PixelFormat
.Format16bppRgb565 };
367
public void Clone_Rectangle_ReturnsExpected(Bitmap bitmap, Rectangle rectangle,
PixelFormat
targetFormat)
403
public void Clone_RectangleF_ReturnsExpected(Bitmap bitmap, Rectangle rectangle,
PixelFormat
format)
445
[InlineData(
PixelFormat
.Max)]
446
[InlineData(
PixelFormat
.Indexed)]
447
[InlineData(
PixelFormat
.Gdi)]
448
[InlineData(
PixelFormat
.Alpha)]
449
[InlineData(
PixelFormat
.PAlpha)]
450
[InlineData(
PixelFormat
.Extended)]
451
[InlineData(
PixelFormat
.Format16bppGrayScale)]
452
[InlineData(
PixelFormat
.Canonical)]
453
public void Clone_InvalidPixelFormat_ThrowsOutOfMemoryException(
PixelFormat
format)
463
using Bitmap bitmap = new(1, 1,
PixelFormat
.Format16bppGrayScale);
464
Assert.Throws<OutOfMemoryException>(() => bitmap.Clone(new Rectangle(0, 0, 1, 1),
PixelFormat
.Format32bppArgb));
465
Assert.Throws<OutOfMemoryException>(() => bitmap.Clone(new RectangleF(0, 0, 1, 1),
PixelFormat
.Format32bppArgb));
485
AssertExtensions.Throws<ArgumentException>(null, () => bitmap.Clone(new Rectangle(0, 0, 1, 1),
PixelFormat
.Format32bppArgb));
486
AssertExtensions.Throws<ArgumentException>(null, () => bitmap.Clone(new RectangleF(0, 0, 1, 1),
PixelFormat
.Format32bppArgb));
532
yield return new object[] { new Bitmap(1, 1,
PixelFormat
.Format1bppIndexed), 0, 0, Color.FromArgb(0, 0, 0) };
533
yield return new object[] { new Bitmap(1, 1,
PixelFormat
.Format4bppIndexed), 0, 0, Color.FromArgb(0, 0, 0) };
534
yield return new object[] { new Bitmap(1, 1,
PixelFormat
.Format8bppIndexed), 0, 0, Color.FromArgb(0, 0, 0) };
535
yield return new object[] { new Bitmap(100, 100,
PixelFormat
.Format32bppRgb), 0, 0, Color.FromArgb(0, 0, 0) };
536
yield return new object[] { new Bitmap(100, 100,
PixelFormat
.Format32bppRgb), 99, 99, Color.FromArgb(0, 0, 0) };
574
using Bitmap bitmap = new(1, 1,
PixelFormat
.Format16bppGrayScale);
589
yield return new object[] { new Bitmap(1, 1,
PixelFormat
.Format32bppRgb), 1, 1 };
590
yield return new object[] { new Bitmap(32, 32,
PixelFormat
.Format32bppArgb), 32, 32 };
591
yield return new object[] { new Bitmap(512, 512,
PixelFormat
.Format16bppRgb555), 512, 512 };
606
Assert.Equal(
PixelFormat
.Format32bppRgb, result.PixelFormat);
619
Assert.Equal(
PixelFormat
.Format32bppRgb, result.PixelFormat);
628
Assert.Equal(
PixelFormat
.Format32bppRgb, result.PixelFormat);
639
using Bitmap bitmap = new(width, height,
PixelFormat
.Format16bppGrayScale);
689
yield return new object[] { new Bitmap(1, 1,
PixelFormat
.Format32bppRgb).GetHicon(), 1, 1 };
690
yield return new object[] { new Bitmap(32, 32,
PixelFormat
.Format32bppRgb).GetHicon(), 32, 32 };
691
yield return new object[] { new Bitmap(512, 512,
PixelFormat
.Format16bppRgb555).GetHicon(), 512, 512 };
703
Assert.Equal(
PixelFormat
.Format32bppArgb, result.PixelFormat);
712
using Bitmap bitmap = new(1, 1,
PixelFormat
.Format16bppGrayScale);
892
using Bitmap bitmap = new(1, 1,
PixelFormat
.Format16bppGrayScale);
914
yield return new object[] { new Bitmap(100, 100,
PixelFormat
.Format32bppRgb), 0, 0, Color.FromArgb(255, 128, 128, 128) };
915
yield return new object[] { new Bitmap(100, 100,
PixelFormat
.Format32bppRgb), 99, 99, Color.FromArgb(255, 128, 128, 128) };
927
[InlineData(
PixelFormat
.Format1bppIndexed)]
928
[InlineData(
PixelFormat
.Format4bppIndexed)]
929
[InlineData(
PixelFormat
.Format8bppIndexed)]
930
public void SetPixel_IndexedPixelFormat_ThrowsInvalidOperationException(
PixelFormat
format)
957
using Bitmap bitmap = new(1, 1,
PixelFormat
.Format16bppGrayScale);
1013
static Bitmap bitmap() => new(2, 2,
PixelFormat
.Format32bppArgb);
1014
yield return new object[] { bitmap(), new Rectangle(0, 0, 2, 2), ImageLockMode.ReadOnly,
PixelFormat
.Format32bppArgb, 8, 1 };
1015
yield return new object[] { bitmap(), new Rectangle(0, 0, 2, 2), ImageLockMode.ReadWrite,
PixelFormat
.Format32bppArgb, 8, 3 };
1016
yield return new object[] { bitmap(), new Rectangle(0, 0, 2, 2), ImageLockMode.WriteOnly,
PixelFormat
.Format32bppArgb, 8, 2 };
1018
yield return new object[] { new Bitmap(100, 100,
PixelFormat
.Format32bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadOnly,
PixelFormat
.Format32bppRgb, 400, 1 };
1019
yield return new object[] { new Bitmap(100, 100,
PixelFormat
.Format32bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadWrite,
PixelFormat
.Format32bppRgb, 400, 3 };
1020
yield return new object[] { new Bitmap(100, 100,
PixelFormat
.Format32bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.WriteOnly,
PixelFormat
.Format32bppRgb, 400, 2 };
1022
yield return new object[] { new Bitmap(100, 100,
PixelFormat
.Format32bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadOnly,
PixelFormat
.Format24bppRgb, 300, 65537 };
1023
yield return new object[] { new Bitmap(100, 100,
PixelFormat
.Format32bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadWrite,
PixelFormat
.Format24bppRgb, 300, 65539 };
1024
yield return new object[] { new Bitmap(100, 100,
PixelFormat
.Format32bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.WriteOnly,
PixelFormat
.Format24bppRgb, 300, 65538 };
1026
yield return new object[] { new Bitmap(100, 100,
PixelFormat
.Format24bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadOnly,
PixelFormat
.Format24bppRgb, 300, 1 };
1027
yield return new object[] { new Bitmap(100, 100,
PixelFormat
.Format24bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadWrite,
PixelFormat
.Format24bppRgb, 300, 3 };
1028
yield return new object[] { new Bitmap(100, 100,
PixelFormat
.Format24bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.WriteOnly,
PixelFormat
.Format24bppRgb, 300, 2 };
1030
yield return new object[] { new Bitmap(100, 100,
PixelFormat
.Format24bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadOnly,
PixelFormat
.Format32bppRgb, 400, 65537 };
1031
yield return new object[] { new Bitmap(100, 100,
PixelFormat
.Format24bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadWrite,
PixelFormat
.Format32bppRgb, 400, 65539 };
1032
yield return new object[] { new Bitmap(100, 100,
PixelFormat
.Format24bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.WriteOnly,
PixelFormat
.Format32bppRgb, 400, 65538 };
1034
yield return new object[] { new Bitmap(100, 100,
PixelFormat
.Format8bppIndexed), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadOnly,
PixelFormat
.Format24bppRgb, 300, 65537 };
1036
yield return new object[] { new Bitmap(100, 100,
PixelFormat
.Format8bppIndexed), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadOnly,
PixelFormat
.Format8bppIndexed, 100, 1 };
1037
yield return new object[] { new Bitmap(100, 100,
PixelFormat
.Format8bppIndexed), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadWrite,
PixelFormat
.Format8bppIndexed, 100, 3 };
1038
yield return new object[] { new Bitmap(100, 100,
PixelFormat
.Format8bppIndexed), new Rectangle(0, 0, 100, 100), ImageLockMode.WriteOnly,
PixelFormat
.Format8bppIndexed, 100, 2 };
1040
yield return new object[] { new Bitmap(184, 184,
PixelFormat
.Format1bppIndexed), new Rectangle(0, 0, 184, 184), ImageLockMode.ReadOnly,
PixelFormat
.Format1bppIndexed, 24, 1 };
1041
yield return new object[] { new Bitmap(184, 184,
PixelFormat
.Format1bppIndexed), new Rectangle(0, 0, 184, 184), ImageLockMode.ReadWrite,
PixelFormat
.Format1bppIndexed, 24, 3 };
1042
yield return new object[] { new Bitmap(184, 184,
PixelFormat
.Format1bppIndexed), new Rectangle(0, 0, 184, 184), ImageLockMode.WriteOnly,
PixelFormat
.Format1bppIndexed, 24, 2 };
1044
yield return new object[] { bitmap(), new Rectangle(1, 1, 1, 1), ImageLockMode.ReadOnly,
PixelFormat
.Format32bppArgb, 8, 1 };
1045
yield return new object[] { bitmap(), new Rectangle(1, 1, 1, 1), ImageLockMode.ReadWrite,
PixelFormat
.Format32bppArgb, 8, 3 };
1046
yield return new object[] { bitmap(), new Rectangle(1, 1, 1, 1), ImageLockMode.WriteOnly,
PixelFormat
.Format32bppArgb, 8, 2 };
1048
yield return new object[] { bitmap(), new Rectangle(1, 1, 1, 1), ImageLockMode.ReadOnly - 1,
PixelFormat
.Format32bppArgb, 8, 0 };
1050
yield return new object[] { bitmap(), new Rectangle(0, 0, 2, 2), ImageLockMode.WriteOnly,
PixelFormat
.Format16bppGrayScale, 4, 65538 };
1052
yield return new object[] { new Bitmap(100, 100,
PixelFormat
.Format32bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadOnly,
PixelFormat
.Format8bppIndexed, 100, 65537 };
1053
yield return new object[] { new Bitmap(100, 100,
PixelFormat
.Format32bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadWrite,
PixelFormat
.Format8bppIndexed, 100, 65539 };
1054
yield return new object[] { new Bitmap(100, 100,
PixelFormat
.Format32bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.WriteOnly,
PixelFormat
.Format8bppIndexed, 100, 65538 };
1056
yield return new object[] { new Bitmap(100, 100,
PixelFormat
.Format8bppIndexed), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadWrite,
PixelFormat
.Format24bppRgb, 300, 65539 };
1057
yield return new object[] { new Bitmap(100, 100,
PixelFormat
.Format8bppIndexed), new Rectangle(0, 0, 100, 100), ImageLockMode.WriteOnly,
PixelFormat
.Format24bppRgb, 300, 65538 };
1062
public void LockBits_Invoke_Success(Bitmap bitmap, Rectangle rectangle, ImageLockMode lockMode,
PixelFormat
pixelFormat, int expectedStride, int expectedReserved)
1076
if (pixelFormat ==
PixelFormat
.Format16bppGrayScale)
1095
AssertExtensions.Throws<ArgumentNullException>("bitmapData", () => bitmap.LockBits(Rectangle.Empty, ImageLockMode.ReadOnly,
PixelFormat
.Format24bppRgb, null));
1121
[InlineData(
PixelFormat
.DontCare)]
1122
[InlineData(
PixelFormat
.Max)]
1123
[InlineData(
PixelFormat
.Indexed)]
1124
[InlineData(
PixelFormat
.Gdi)]
1125
[InlineData(
PixelFormat
.Alpha)]
1126
[InlineData(
PixelFormat
.PAlpha)]
1127
[InlineData(
PixelFormat
.Extended)]
1128
[InlineData(
PixelFormat
.Canonical)]
1129
public void LockBits_InvalidPixelFormat_ThrowsArgumentException(
PixelFormat
format)
1146
AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly,
PixelFormat
.Format16bppGrayScale));
1147
AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly,
PixelFormat
.Format16bppGrayScale, new BitmapData()));
1149
AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadWrite,
PixelFormat
.Format16bppGrayScale));
1150
AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadWrite,
PixelFormat
.Format16bppGrayScale, new BitmapData()));
1152
BitmapData data = bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.WriteOnly,
PixelFormat
.Format16bppGrayScale);
1175
AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly,
PixelFormat
.Format32bppArgb));
1178
AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly,
PixelFormat
.Format32bppArgb, bitmapData));
1220
[InlineData(
PixelFormat
.Indexed)]
1221
[InlineData(
PixelFormat
.Gdi)]
1222
public void UnlockBits_InvalidPixelFormat_Nop(
PixelFormat
format)
1276
[InlineData(
PixelFormat
.Format16bppArgb1555)]
1277
[InlineData(
PixelFormat
.Format16bppRgb555)]
1278
[InlineData(
PixelFormat
.Format16bppRgb565)]
1279
[InlineData(
PixelFormat
.Format32bppArgb)]
1280
[InlineData(
PixelFormat
.Format32bppPArgb)]
1281
[InlineData(
PixelFormat
.Format32bppRgb)]
1282
[InlineData(
PixelFormat
.Format24bppRgb)]
1283
public void CustomPixelFormat_GetPixels_ReturnsExpected(
PixelFormat
format)
1298
if (format ==
PixelFormat
.Format16bppRgb565)
1311
if (format ==
PixelFormat
.Format16bppRgb565)
1324
if (format ==
PixelFormat
.Format32bppPArgb)
1353
if (format ==
PixelFormat
.Format32bppPArgb)
1368
case
PixelFormat
.Format16bppRgb565:
1374
case
PixelFormat
.Format16bppArgb1555:
1380
case
PixelFormat
.Format16bppRgb555:
1396
if (format ==
PixelFormat
.Format32bppRgb)
1411
if (format ==
PixelFormat
.Format32bppRgb)
1428
public static TheoryData<
PixelFormat
, int[]> Palette_TestData => new()
1430
{
PixelFormat
.Format1bppIndexed, new int[] { -16777216, -1 } },
1431
{
PixelFormat
.Format4bppIndexed, new int[] { -16777216, -8388608, -16744448, -8355840, -16777088, -8388480, -16744320, -8355712, -4144960, -65536, -16711936, -256, -16776961, -65281, -16711681, -1, } },
1432
{
PixelFormat
.Format8bppIndexed, new int[] { -16777216, -8388608, -16744448, -8355840, -16777088, -8388480, -16744320, -8355712, -4144960, -65536, -16711936, -256, -16776961, -65281, -16711681, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -16777216, -16777165, -16777114, -16777063, -16777012, -16776961, -16764160, -16764109, -16764058, -16764007, -16763956, -16763905, -16751104, -16751053, -16751002, -16750951, -16750900, -16750849, -16738048, -16737997, -16737946, -16737895, -16737844, -16737793, -16724992, -16724941, -16724890, -16724839, -16724788, -16724737, -16711936, -16711885, -16711834, -16711783, -16711732, -16711681, -13434880, -13434829, -13434778, -13434727, -13434676, -13434625, -13421824, -13421773, -13421722, -13421671, -13421620, -13421569, -13408768, -13408717, -13408666, -13408615, -13408564, -13408513, -13395712, -13395661, -13395610, -13395559, -13395508, -13395457, -13382656, -13382605, -13382554, -13382503, -13382452, -13382401, -13369600, -13369549, -13369498, -13369447, -13369396, -13369345, -10092544, -10092493, -10092442, -10092391, -10092340, -10092289, -10079488, -10079437, -10079386, -10079335, -10079284, -10079233, -10066432, -10066381, -10066330, -10066279, -10066228, -10066177, -10053376, -10053325, -10053274, -10053223, -10053172, -10053121, -10040320, -10040269, -10040218, -10040167, -10040116, -10040065, -10027264, -10027213, -10027162, -10027111, -10027060, -10027009, -6750208, -6750157, -6750106, -6750055, -6750004, -6749953, -6737152, -6737101, -6737050, -6736999, -6736948, -6736897, -6724096, -6724045, -6723994, -6723943, -6723892, -6723841, -6711040, -6710989, -6710938, -6710887, -6710836, -6710785, -6697984, -6697933, -6697882, -6697831, -6697780, -6697729, -6684928, -6684877, -6684826, -6684775, -6684724, -6684673, -3407872, -3407821, -3407770, -3407719, -3407668, -3407617, -3394816, -3394765, -3394714, -3394663, -3394612, -3394561, -3381760, -3381709, -3381658, -3381607, -3381556, -3381505, -3368704, -3368653, -3368602, -3368551, -3368500, -3368449, -3355648, -3355597, -3355546, -3355495, -3355444, -3355393, -3342592, -3342541, -3342490, -3342439, -3342388, -3342337, -65536, -65485, -65434, -65383, -65332, -65281, -52480, -52429, -52378, -52327, -52276, -52225, -39424, -39373, -39322, -39271, -39220, -39169, -26368, -26317, -26266, -26215, -26164, -26113, -13312, -13261, -13210, -13159, -13108, -13057, -256, -205, -154, -103, -52, -1 } }
1437
public void Palette_Get_ReturnsExpected(
PixelFormat
pixelFormat, int[] expectedEntries)
1468
using (Bitmap bitmap = new(1, 1,
PixelFormat
.Format32bppRgb))
1474
BitmapData data = bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly,
PixelFormat
.Format32bppArgb);
1503
data = bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadWrite,
PixelFormat
.Format32bppArgb);
1523
using (Bitmap bitmap = new(1, 1,
PixelFormat
.Format32bppArgb))
1527
BitmapData data = bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly,
PixelFormat
.Format24bppRgb);
1546
data = bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadWrite,
PixelFormat
.Format24bppRgb);
1605
public static TheoryData<
PixelFormat
, DitherType, PaletteType> Convert_Valid { get; } = new()
1608
{
PixelFormat
.Format16bppArgb1555, DitherType.None, PaletteType.FixedHalftone8 },
1609
{
PixelFormat
.Format16bppRgb555, DitherType.Spiral8x8, PaletteType.FixedHalftone8 },
1610
{
PixelFormat
.Format16bppRgb565, DitherType.Ordered8x8, PaletteType.FixedHalftone8 },
1611
{
PixelFormat
.Format24bppRgb, DitherType.Ordered4x4, PaletteType.FixedHalftone8 },
1612
{
PixelFormat
.Format32bppArgb, DitherType.DualSpiral4x4, PaletteType.FixedHalftone8 },
1613
{
PixelFormat
.Format32bppPArgb, DitherType.ErrorDiffusion, PaletteType.FixedHalftone8 },
1614
{
PixelFormat
.Format32bppRgb, DitherType.Solid, PaletteType.FixedHalftone8 },
1615
{
PixelFormat
.Format16bppArgb1555, DitherType.None, PaletteType.FixedHalftone256 },
1616
{
PixelFormat
.Format16bppRgb555, DitherType.DualSpiral8x8, PaletteType.FixedHalftone256 },
1617
{
PixelFormat
.Format16bppRgb565, DitherType.None, PaletteType.FixedHalftone256 },
1618
{
PixelFormat
.Format24bppRgb, DitherType.None, PaletteType.FixedHalftone256 },
1619
{
PixelFormat
.Format32bppArgb, DitherType.None, PaletteType.FixedHalftone256 },
1620
{
PixelFormat
.Format32bppPArgb, DitherType.None, PaletteType.FixedHalftone256 },
1621
{
PixelFormat
.Format32bppRgb, DitherType.None, PaletteType.FixedHalftone256 },
1622
{
PixelFormat
.Format16bppRgb565, DitherType.None, (PaletteType)(-1) },
1625
public static TheoryData<
PixelFormat
, DitherType, PaletteType> Convert_InvalidArgument { get; } = new()
1628
{
PixelFormat
.Format1bppIndexed, (DitherType)(-1), PaletteType.FixedHalftone256 },
1629
{
PixelFormat
.Format1bppIndexed, DitherType.None, (PaletteType)(-1) },
1630
{
PixelFormat
.Format1bppIndexed, (DitherType)(-1), (PaletteType)(-1) },
1631
{
PixelFormat
.Format1bppIndexed, DitherType.None, PaletteType.FixedHalftone256 },
1632
{
PixelFormat
.Format1bppIndexed, DitherType.ErrorDiffusion, PaletteType.FixedHalftone8 },
1633
{
PixelFormat
.Format4bppIndexed, DitherType.Solid, PaletteType.FixedHalftone64 },
1634
{
PixelFormat
.Format4bppIndexed, DitherType.None, PaletteType.FixedHalftone8 },
1635
{
PixelFormat
.Format4bppIndexed, DitherType.ErrorDiffusion, PaletteType.FixedHalftone8 },
1636
{
PixelFormat
.Format8bppIndexed, DitherType.None, PaletteType.FixedHalftone256 },
1637
{
PixelFormat
.Format8bppIndexed, DitherType.Solid, PaletteType.FixedHalftone27 },
1639
{
PixelFormat
.Format16bppGrayScale, DitherType.None, PaletteType.FixedHalftone256 },
1640
{
PixelFormat
.Format16bppGrayScale, DitherType.ErrorDiffusion, PaletteType.FixedHalftone8 },
1641
{
PixelFormat
.Format16bppGrayScale, DitherType.None, PaletteType.FixedBlackAndWhite },
1642
{
PixelFormat
.Format16bppGrayScale, DitherType.Solid, PaletteType.FixedBlackAndWhite },
1643
{
PixelFormat
.Format16bppRgb565, (DitherType)(-1), PaletteType.FixedHalftone256 },
1644
{
PixelFormat
.Format16bppRgb565, (DitherType)(-1), (PaletteType)(-1) },
1649
public void Bitmap_Convert_BasicPixelFormat(
PixelFormat
format, DitherType dither, PaletteType palette)
1658
public void Bitmap_Convert_ArgumentException(
PixelFormat
format, DitherType dither, PaletteType palette)
1664
public static TheoryData<
PixelFormat
> AllValidPixelFormats { get; } = new()
1666
PixelFormat
.Format16bppArgb1555,
1667
PixelFormat
.Format16bppRgb555,
1668
PixelFormat
.Format16bppRgb565,
1669
PixelFormat
.Format24bppRgb,
1670
PixelFormat
.Format32bppArgb,
1671
PixelFormat
.Format32bppPArgb,
1672
PixelFormat
.Format32bppRgb,
1673
PixelFormat
.Format48bppRgb,
1674
PixelFormat
.Format64bppArgb,
1675
PixelFormat
.Format64bppPArgb,
1676
PixelFormat
.Format8bppIndexed,
1677
PixelFormat
.Format1bppIndexed,
1678
PixelFormat
.Format4bppIndexed
1683
public void Bitmap_Convert_SingleArgument(
PixelFormat
format)
System\Drawing\GraphicsTests.cs (30)
239
[InlineData(
PixelFormat
.Format16bppRgb555)]
240
[InlineData(
PixelFormat
.Format16bppRgb565)]
241
[InlineData(
PixelFormat
.Format24bppRgb)]
242
[InlineData(
PixelFormat
.Format32bppArgb)]
243
[InlineData(
PixelFormat
.Format32bppPArgb)]
244
[InlineData(
PixelFormat
.Format32bppRgb)]
245
[InlineData(
PixelFormat
.Format48bppRgb)]
246
[InlineData(
PixelFormat
.Format64bppArgb)]
247
[InlineData(
PixelFormat
.Format64bppPArgb)]
248
public void FromImage_Bitmap_Success(
PixelFormat
format)
262
[InlineData(
PixelFormat
.Format1bppIndexed)]
263
[InlineData(
PixelFormat
.Format4bppIndexed)]
264
[InlineData(
PixelFormat
.Format8bppIndexed)]
265
public void FromImage_IndexedImage_ThrowsException(
PixelFormat
format)
290
[InlineData(
PixelFormat
.Format16bppArgb1555)]
291
[InlineData(
PixelFormat
.Format16bppGrayScale)]
292
public void FromImage_Invalid16BitFormat_ThrowsOutOfMemoryException(
PixelFormat
format)
1916
yield return new object[] {
PixelFormat
.Format32bppArgb, Color.Red, Color.FromArgb(Color.Red.ToArgb()) };
1917
yield return new object[] {
PixelFormat
.Format16bppRgb555, Color.Red, Color.FromArgb(255, 248, 0, 0) };
1922
public void GetNearestColor_Color_ReturnsExpected(
PixelFormat
pixelFormat, Color color, Color expected)
2914
[InlineData(
PixelFormat
.Format16bppRgb555,
PixelFormat
.Format32bppRgb, false)]
2915
[InlineData(
PixelFormat
.Format32bppRgb,
PixelFormat
.Format16bppRgb555, true)]
2916
[InlineData(
PixelFormat
.Format32bppArgb,
PixelFormat
.Format16bppRgb555, false)]
2918
PixelFormat
sourceFormat,
2919
PixelFormat
destinationFormat,
2942
BitmapData data = bitmap.LockBits(default, ImageLockMode.ReadOnly,
PixelFormat
.Format32bppArgb);
2956
BitmapData data = bitmap.LockBits(default, ImageLockMode.ReadOnly,
PixelFormat
.Format32bppArgb);
System\Drawing\IconTests.cs (2)
525
Assert.Equal(
PixelFormat
.Format32bppArgb, bitmap.PixelFormat);
563
Assert.Equal(
PixelFormat
.Format32bppArgb, bitmap.PixelFormat);
System\Drawing\ImageTests.cs (30)
571
[InlineData(
PixelFormat
.Format1bppIndexed, 1)]
572
[InlineData(
PixelFormat
.Format4bppIndexed, 4)]
573
[InlineData(
PixelFormat
.Format8bppIndexed, 8)]
574
[InlineData(
PixelFormat
.Format16bppArgb1555, 16)]
575
[InlineData(
PixelFormat
.Format16bppGrayScale, 16)]
576
[InlineData(
PixelFormat
.Format16bppRgb555, 16)]
577
[InlineData(
PixelFormat
.Format16bppRgb565, 16)]
578
[InlineData(
PixelFormat
.Format24bppRgb, 24)]
579
[InlineData(
PixelFormat
.Format32bppArgb, 32)]
580
[InlineData(
PixelFormat
.Format32bppPArgb, 32)]
581
[InlineData(
PixelFormat
.Format32bppRgb, 32)]
582
[InlineData(
PixelFormat
.Format48bppRgb, 48)]
583
[InlineData(
PixelFormat
.Format64bppArgb, 64)]
584
[InlineData(
PixelFormat
.Format64bppPArgb, 64)]
585
public void GetPixelFormatSize_ReturnsExpected(
PixelFormat
format, int expectedSize)
591
[InlineData(
PixelFormat
.Format16bppArgb1555, true)]
592
[InlineData(
PixelFormat
.Format32bppArgb, true)]
593
[InlineData(
PixelFormat
.Format32bppPArgb, true)]
594
[InlineData(
PixelFormat
.Format64bppArgb, true)]
595
[InlineData(
PixelFormat
.Format64bppPArgb, true)]
596
[InlineData(
PixelFormat
.Format16bppGrayScale, false)]
597
[InlineData(
PixelFormat
.Format16bppRgb555, false)]
598
[InlineData(
PixelFormat
.Format16bppRgb565, false)]
599
[InlineData(
PixelFormat
.Format1bppIndexed, false)]
600
[InlineData(
PixelFormat
.Format24bppRgb, false)]
601
[InlineData(
PixelFormat
.Format32bppRgb, false)]
602
[InlineData(
PixelFormat
.Format48bppRgb, false)]
603
[InlineData(
PixelFormat
.Format4bppIndexed, false)]
604
[InlineData(
PixelFormat
.Format8bppIndexed, false)]
605
public void IsAlphaPixelFormat_ReturnsExpected(
PixelFormat
format, bool expected)
System\Drawing\Imaging\BitmapDataTests.cs (25)
17
Assert.Equal((
PixelFormat
)0, bd.PixelFormat);
86
[InlineData(
PixelFormat
.DontCare)]
87
[InlineData(
PixelFormat
.Max)]
88
[InlineData(
PixelFormat
.Indexed)]
89
[InlineData(
PixelFormat
.Gdi)]
90
[InlineData(
PixelFormat
.Format16bppRgb555)]
91
[InlineData(
PixelFormat
.Format16bppRgb565)]
92
[InlineData(
PixelFormat
.Format24bppRgb)]
93
[InlineData(
PixelFormat
.Format32bppRgb)]
94
[InlineData(
PixelFormat
.Format1bppIndexed)]
95
[InlineData(
PixelFormat
.Format4bppIndexed)]
96
[InlineData(
PixelFormat
.Format8bppIndexed)]
97
[InlineData(
PixelFormat
.Alpha)]
98
[InlineData(
PixelFormat
.Format16bppArgb1555)]
99
[InlineData(
PixelFormat
.PAlpha)]
100
[InlineData(
PixelFormat
.Format32bppPArgb)]
101
[InlineData(
PixelFormat
.Extended)]
102
[InlineData(
PixelFormat
.Format16bppGrayScale)]
103
[InlineData(
PixelFormat
.Format48bppRgb)]
104
[InlineData(
PixelFormat
.Format64bppPArgb)]
105
[InlineData(
PixelFormat
.Canonical)]
106
[InlineData(
PixelFormat
.Format32bppArgb)]
107
[InlineData(
PixelFormat
.Format64bppArgb)]
108
public void PixelFormat_SetValid_ReturnsExpected(
PixelFormat
pixelFormat)
121
Assert.ThrowsAny<ArgumentException>(() => bd.PixelFormat = (
PixelFormat
)(-1));
System\Drawing\Imaging\MetafileTests.cs (43)
125
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
144
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
171
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
187
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
207
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
217
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
228
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
237
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
247
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
257
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
268
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
304
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
322
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
340
using (Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb))
356
using (Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb))
373
using (Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb))
400
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
411
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
424
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
436
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
449
using (Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb))
465
using (Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb))
481
using (Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb))
498
using (Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb))
516
using (Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb))
533
using (Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb))
549
using (Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb))
565
using (Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb))
582
using (Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb))
600
using (Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb))
638
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
660
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
678
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
695
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
711
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
727
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
738
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
749
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
761
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
774
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
800
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
815
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
827
using Bitmap bmp = new(10, 10,
PixelFormat
.Format32bppArgb);
System\Drawing\TextureBrushTests.cs (11)
13
yield return new object[] { new Bitmap(10, 10),
PixelFormat
.Format32bppPArgb, new Size(10, 10) };
14
yield return new object[] { new Metafile(Helpers.GetTestBitmapPath("telescope_01.wmf")),
PixelFormat
.Format32bppArgb, new Size(490, 654) };
19
public void Ctor_Bitmap(Image bitmap,
PixelFormat
expectedPixelFormat, Size expectedSize)
43
Ctor_Bitmap(image,
PixelFormat
.Format32bppPArgb, new Size(11, 22));
60
public void Ctor_Image_WrapMode(Image image, WrapMode wrapMode,
PixelFormat
expectedPixelFormat, Size expectedSize)
95
Assert.Equal(
PixelFormat
.Format32bppPArgb, brushImage.PixelFormat);
116
Assert.Equal(
PixelFormat
.Format32bppPArgb, brushImage.PixelFormat);
149
Assert.Equal(
PixelFormat
.Format32bppPArgb, brushImage.PixelFormat);
170
Assert.Equal(
PixelFormat
.Format32bppPArgb, brushImage.PixelFormat);
204
Assert.Equal(
PixelFormat
.Format32bppPArgb, brushImage.PixelFormat);
226
Assert.Equal(
PixelFormat
.Format32bppPArgb, brushImage.PixelFormat);
System.Windows.Forms (6)
System\Windows\Forms\Controls\ImageList\ImageList.cs (4)
573
if (bmpData.PixelFormat is not
PixelFormat
.Format32bppArgb and not
PixelFormat
.Format32bppRgb)
631
result = new Bitmap(_imageSize.Width, _imageSize.Height,
PixelFormat
.Format32bppArgb);
632
targetData = result.LockBits(new Rectangle(0, 0, _imageSize.Width, _imageSize.Height), ImageLockMode.WriteOnly,
PixelFormat
.Format32bppArgb);
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (1)
877
using Bitmap textBmp = new(textSize.Width, textSize.Height,
PixelFormat
.Format32bppPArgb);
System\Windows\Forms\Rendering\ControlPaint.cs (1)
267
PixelFormat
.Format32bppArgb);
System.Windows.Forms.Design (6)
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (1)
1019
_dragImage = new Bitmap(imageWidth, imageHeight, Drawing.Imaging.
PixelFormat
.Format32bppPArgb);
System\Windows\Forms\Design\DesignerUtils.cs (4)
120
s_boxImage = new Bitmap(s_boxImageSize, s_boxImageSize,
PixelFormat
.Format32bppPArgb);
392
PixelFormat
.Format32bppPArgb);
425
PixelFormat
.Format32bppPArgb);
671
BitmapData data = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite,
PixelFormat
.Format32bppArgb);
System\Windows\Forms\Design\ImageListImage.cs (1)
42
public
PixelFormat
PixelFormat => Image.PixelFormat;
System.Windows.Forms.Tests (245)
System\Windows\Forms\AxHostTests.cs (2)
1627
Assert.Equal(
PixelFormat
.Format32bppRgb, result.PixelFormat);
1692
Assert.Equal(
PixelFormat
.Format32bppRgb, result.PixelFormat);
System\Windows\Forms\ControlPaintTests.cs (40)
15
yield return new object[] { new Bitmap(10, 10,
PixelFormat
.Format1bppIndexed), Color.Empty };
16
yield return new object[] { new Bitmap(10, 10,
PixelFormat
.Format32bppRgb), Color.Empty };
17
yield return new object[] { new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), Color.Empty };
18
yield return new object[] { new Bitmap(10, 10,
PixelFormat
.Format1bppIndexed), Color.Red };
19
yield return new object[] { new Bitmap(10, 10,
PixelFormat
.Format32bppRgb), Color.Red };
20
yield return new object[] { new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), Color.Red };
21
yield return new object[] { new Bitmap(10, 10,
PixelFormat
.Format1bppIndexed), Color.Transparent };
22
yield return new object[] { new Bitmap(10, 10,
PixelFormat
.Format32bppRgb), Color.Transparent };
23
yield return new object[] { new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), Color.Transparent };
24
yield return new object[] { new Bitmap(11, 11,
PixelFormat
.Format1bppIndexed), Color.Red };
25
yield return new object[] { new Bitmap(11, 11,
PixelFormat
.Format32bppRgb), Color.Red };
26
yield return new object[] { new Bitmap(11, 11,
PixelFormat
.Format32bppArgb), Color.Red };
27
yield return new object[] { new Bitmap(16, 24,
PixelFormat
.Format1bppIndexed), Color.Red };
28
yield return new object[] { new Bitmap(16, 24,
PixelFormat
.Format32bppRgb), Color.Red };
29
yield return new object[] { new Bitmap(16, 24,
PixelFormat
.Format32bppArgb), Color.Red };
43
Assert.Equal(
PixelFormat
.Format16bppRgb555, result.PixelFormat);
68
Assert.Equal(
PixelFormat
.Format16bppRgb555, result.PixelFormat);
91
yield return new object[] { new Bitmap(10, 10,
PixelFormat
.Format1bppIndexed), monochromeMask };
92
yield return new object[] { new Bitmap(10, 10,
PixelFormat
.Format32bppRgb), monochromeMask };
93
yield return new object[] { new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), monochromeMask };
94
yield return new object[] { new Bitmap(16, 24,
PixelFormat
.Format1bppIndexed), monochromeMask };
95
yield return new object[] { new Bitmap(16, 24,
PixelFormat
.Format32bppRgb), monochromeMask };
96
yield return new object[] { new Bitmap(16, 24,
PixelFormat
.Format32bppArgb), monochromeMask };
97
yield return new object[] { new Bitmap(11, 11,
PixelFormat
.Format1bppIndexed), monochromeMask };
98
yield return new object[] { new Bitmap(11, 11,
PixelFormat
.Format32bppRgb), monochromeMask };
99
yield return new object[] { new Bitmap(11, 11,
PixelFormat
.Format32bppArgb), monochromeMask };
114
Assert.Equal(
PixelFormat
.Format32bppRgb, result.PixelFormat);
146
Assert.Equal(
PixelFormat
.Format32bppRgb, result.PixelFormat);
179
Assert.Equal(
PixelFormat
.Format32bppRgb, result.PixelFormat);
200
yield return new object[] { new Bitmap(10, 10,
PixelFormat
.Format1bppIndexed) };
201
yield return new object[] { new Bitmap(10, 10,
PixelFormat
.Format32bppRgb) };
202
yield return new object[] { new Bitmap(10, 10,
PixelFormat
.Format32bppArgb) };
203
yield return new object[] { new Bitmap(16, 24,
PixelFormat
.Format1bppIndexed) };
204
yield return new object[] { new Bitmap(16, 24,
PixelFormat
.Format32bppRgb) };
205
yield return new object[] { new Bitmap(16, 24,
PixelFormat
.Format32bppArgb) };
206
yield return new object[] { new Bitmap(11, 11,
PixelFormat
.Format1bppIndexed) };
207
yield return new object[] { new Bitmap(11, 11,
PixelFormat
.Format32bppRgb) };
208
yield return new object[] { new Bitmap(11, 11,
PixelFormat
.Format32bppArgb) };
222
Assert.Equal(
PixelFormat
.Format1bppIndexed, result.PixelFormat);
247
Assert.Equal(
PixelFormat
.Format1bppIndexed, result.PixelFormat);
System\Windows\Forms\ControlTests.Handlers.cs (41)
3838
foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10,
PixelFormat
.Format32bppRgb), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb) })
3901
foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10,
PixelFormat
.Format32bppRgb) })
3914
yield return new object[] { parent, true, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
3915
yield return new object[] { parent, true, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
3916
yield return new object[] { parent, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 1 };
3917
yield return new object[] { parent, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 1 };
3918
yield return new object[] { parent, false, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
3919
yield return new object[] { parent, false, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
3921
yield return new object[] { parent, true, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
3922
yield return new object[] { parent, true, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
3923
yield return new object[] { parent, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 2 };
3924
yield return new object[] { parent, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 2 };
3925
yield return new object[] { parent, false, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
3926
yield return new object[] { parent, false, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
3945
foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10,
PixelFormat
.Format32bppRgb) })
3958
yield return new object[] { parent, true, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
3959
yield return new object[] { parent, true, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
3960
yield return new object[] { parent, false, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
3961
yield return new object[] { parent, false, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
3962
yield return new object[] { parent, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, expected1 };
3963
yield return new object[] { parent, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, expected1 };
3965
yield return new object[] { parent, true, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, expected1 };
3966
yield return new object[] { parent, true, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, expected1 };
3967
yield return new object[] { parent, false, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, expected1 };
3968
yield return new object[] { parent, false, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, expected1 };
3969
yield return new object[] { parent, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, expected1 };
3970
yield return new object[] { parent, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, expected1 };
4073
foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10,
PixelFormat
.Format32bppRgb) })
4086
yield return new object[] { true, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
4087
yield return new object[] { true, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
4088
yield return new object[] { true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 1 };
4089
yield return new object[] { true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 1 };
4090
yield return new object[] { false, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
4091
yield return new object[] { false, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
4093
yield return new object[] { true, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
4094
yield return new object[] { true, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
4095
yield return new object[] { true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
4096
yield return new object[] { true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
4097
yield return new object[] { false, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
4098
yield return new object[] { false, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
System\Windows\Forms\ControlTests.Properties.cs (10)
2041
yield return new object[] { new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, false };
2042
yield return new object[] { new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, false };
2043
yield return new object[] { new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Center, true };
2044
yield return new object[] { new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Stretch, true };
2045
yield return new object[] { new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Zoom, true };
2047
yield return new object[] { new Bitmap(10, 10,
PixelFormat
.Format32bppRgb), ImageLayout.None, false };
2048
yield return new object[] { new Bitmap(10, 10,
PixelFormat
.Format32bppRgb), ImageLayout.Tile, false };
2049
yield return new object[] { new Bitmap(10, 10,
PixelFormat
.Format32bppRgb), ImageLayout.Center, false };
2050
yield return new object[] { new Bitmap(10, 10,
PixelFormat
.Format32bppRgb), ImageLayout.Stretch, false };
2051
yield return new object[] { new Bitmap(10, 10,
PixelFormat
.Format32bppRgb), ImageLayout.Zoom, false };
System\Windows\Forms\ImageList.ImageCollectionTests.cs (42)
52
using Bitmap image1bppIndexed = new(1, 2,
PixelFormat
.Format24bppRgb);
53
using Bitmap image24bppRGb = new(3, 4,
PixelFormat
.Format24bppRgb);
54
using Bitmap image32bppRGb = new(5, 6,
PixelFormat
.Format32bppRgb);
55
using Bitmap image32bppArgbNotTransparent = new(7, 8,
PixelFormat
.Format32bppArgb);
56
using Bitmap image32bppArgbTransparent = new(9, 10,
PixelFormat
.Format32bppArgb);
68
Assert.Equal(
PixelFormat
.Format32bppArgb, bitmap1.PixelFormat);
73
Assert.Equal(
PixelFormat
.Format32bppArgb, bitmap2.PixelFormat);
78
Assert.Equal(
PixelFormat
.Format32bppArgb, bitmap3.PixelFormat);
83
Assert.Equal(
PixelFormat
.Format32bppArgb, bitmap4.PixelFormat);
88
Assert.Equal(
PixelFormat
.Format32bppArgb, bitmap5.PixelFormat);
100
using Bitmap image1bppIndexed = new(1, 2,
PixelFormat
.Format24bppRgb);
101
using Bitmap image24bppRGb = new(3, 4,
PixelFormat
.Format24bppRgb);
102
using Bitmap image32bppRGb = new(5, 6,
PixelFormat
.Format32bppRgb);
103
using Bitmap image32bppArgbNotTransparent = new(7, 8,
PixelFormat
.Format32bppArgb);
104
using Bitmap image32bppArgbTransparent = new(9, 10,
PixelFormat
.Format32bppArgb);
116
Assert.Equal(
PixelFormat
.Format32bppArgb, bitmap1.PixelFormat);
121
Assert.Equal(
PixelFormat
.Format32bppArgb, bitmap2.PixelFormat);
126
Assert.Equal(
PixelFormat
.Format32bppArgb, bitmap3.PixelFormat);
131
Assert.Equal(
PixelFormat
.Format32bppArgb, bitmap4.PixelFormat);
136
Assert.Equal(
PixelFormat
.Format32bppArgb, bitmap5.PixelFormat);
144
PixelFormat
.Format1bppIndexed,
145
PixelFormat
.Format24bppRgb,
146
PixelFormat
.Format32bppRgb,
147
PixelFormat
.Format32bppArgb,
148
PixelFormat
.Format32bppPArgb,
153
foreach (
PixelFormat
pixelFormat in pixelFormats)
156
yield return new object[] {
PixelFormat
.Format24bppRgb, Color.Red, Color.FromArgb(200, 50, 75, 100) };
163
yield return new object[] {
PixelFormat
.Format1bppIndexed, Color.Empty, Color.Empty, Color.FromArgb(255, 0, 0, 0) };
169
yield return new object[] {
PixelFormat
.Format24bppRgb, Color.Red, Color.FromArgb(200, 50, 75, 100), Color.FromArgb(255, 50, 75, 100) };
170
yield return new object[] {
PixelFormat
.Format32bppRgb, Color.Red, Color.FromArgb(200, 50, 75, 100), Color.FromArgb(255, 50, 75, 100) };
186
public void ImageCollection_Item_Get32bppColorDepth_Success(
PixelFormat
pixelFormat, Color pixel00Color, Color givenPixel10Color, Color expectedPixel10Color)
212
Assert.Equal(
PixelFormat
.Format32bppArgb, resultImage.PixelFormat);
275
Assert.Equal(
PixelFormat
.Format32bppArgb, bitmap.PixelFormat);
296
Assert.Equal(
PixelFormat
.Format32bppArgb, bitmap.PixelFormat);
362
Assert.Equal(
PixelFormat
.Format32bppArgb, result1.PixelFormat);
369
Assert.Equal(
PixelFormat
.Format32bppArgb, result1.PixelFormat);
1174
Assert.Equal(
PixelFormat
.Format32bppArgb, result1.PixelFormat);
1180
Assert.Equal(
PixelFormat
.Format32bppArgb, result2.PixelFormat);
1212
Assert.Equal(
PixelFormat
.Format32bppArgb, result1.PixelFormat);
1218
Assert.Equal(
PixelFormat
.Format32bppArgb, result2.PixelFormat);
1648
Assert.Equal(
PixelFormat
.Format32bppArgb, bitmap.PixelFormat);
1669
Assert.Equal(
PixelFormat
.Format32bppArgb, bitmap.PixelFormat);
System\Windows\Forms\ScrollableControlTests.cs (41)
1512
foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10,
PixelFormat
.Format32bppRgb), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb) })
1584
foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10,
PixelFormat
.Format32bppRgb) })
1598
yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
1599
yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
1600
yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 1 };
1601
yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 1 };
1602
yield return new object[] { parentFactory(), hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
1603
yield return new object[] { parentFactory(), hScroll, vScroll, false, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
1605
yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
1606
yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
1607
yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 2 };
1608
yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 2 };
1609
yield return new object[] { parentFactory(), hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
1610
yield return new object[] { parentFactory(), hScroll, vScroll, false, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
1628
foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10,
PixelFormat
.Format32bppRgb) })
1648
yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
1649
yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
1650
yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, expected1 };
1651
yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, expected1 };
1652
yield return new object[] { parentFactory(), hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
1653
yield return new object[] { parentFactory(), hScroll, vScroll, false, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
1655
yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, expected1 };
1656
yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, expected1 };
1657
yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, expected1 };
1658
yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, expected1 };
1659
yield return new object[] { parentFactory(), hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, expected1 };
1660
yield return new object[] { parentFactory(), hScroll, vScroll, false, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, expected1 };
1784
foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10,
PixelFormat
.Format32bppRgb) })
1798
yield return new object[] { hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
1799
yield return new object[] { hScroll, vScroll, true, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
1800
yield return new object[] { hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 1 };
1801
yield return new object[] { hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 1 };
1802
yield return new object[] { hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
1803
yield return new object[] { hScroll, vScroll, false, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
1805
yield return new object[] { hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
1806
yield return new object[] { hScroll, vScroll, true, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
1807
yield return new object[] { hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
1808
yield return new object[] { hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
1809
yield return new object[] { hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
1810
yield return new object[] { hScroll, vScroll, false, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
System\Windows\Forms\TabPageTests.cs (28)
3960
foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10,
PixelFormat
.Format32bppRgb), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb) })
4014
foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10,
PixelFormat
.Format32bppRgb) })
4027
yield return new object[] { appearance, useVisualStyleBackColor, true, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
4028
yield return new object[] { appearance, useVisualStyleBackColor, true, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
4029
yield return new object[] { appearance, useVisualStyleBackColor, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 1 };
4030
yield return new object[] { appearance, useVisualStyleBackColor, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 1 };
4031
yield return new object[] { appearance, useVisualStyleBackColor, false, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
4032
yield return new object[] { appearance, useVisualStyleBackColor, false, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
4034
yield return new object[] { appearance, useVisualStyleBackColor, true, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
4035
yield return new object[] { appearance, useVisualStyleBackColor, true, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
4036
yield return new object[] { appearance, useVisualStyleBackColor, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
4037
yield return new object[] { appearance, useVisualStyleBackColor, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
4038
yield return new object[] { appearance, useVisualStyleBackColor, false, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
4039
yield return new object[] { appearance, useVisualStyleBackColor, false, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
4153
foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10,
PixelFormat
.Format32bppRgb) })
4166
yield return new object[] { appearance, useVisualStyleBackColor, true, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
4167
yield return new object[] { appearance, useVisualStyleBackColor, true, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
4168
yield return new object[] { appearance, useVisualStyleBackColor, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 1 };
4169
yield return new object[] { appearance, useVisualStyleBackColor, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 1 };
4170
yield return new object[] { appearance, useVisualStyleBackColor, false, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
4171
yield return new object[] { appearance, useVisualStyleBackColor, false, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
4173
yield return new object[] { appearance, useVisualStyleBackColor, true, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
4174
yield return new object[] { appearance, useVisualStyleBackColor, true, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
4175
yield return new object[] { appearance, useVisualStyleBackColor, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
4176
yield return new object[] { appearance, useVisualStyleBackColor, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
4177
yield return new object[] { appearance, useVisualStyleBackColor, false, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
4178
yield return new object[] { appearance, useVisualStyleBackColor, false, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
System\Windows\Forms\ToolStripTests.cs (41)
5853
foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10,
PixelFormat
.Format32bppRgb), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb) })
5926
foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10,
PixelFormat
.Format32bppRgb) })
5940
yield return new object[] { parent, hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
5941
yield return new object[] { parent, hScroll, vScroll, true, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
5942
yield return new object[] { parent, hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 1 };
5943
yield return new object[] { parent, hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 1 };
5944
yield return new object[] { parent, hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
5945
yield return new object[] { parent, hScroll, vScroll, false, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
5947
yield return new object[] { parent, hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
5948
yield return new object[] { parent, hScroll, vScroll, true, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
5949
yield return new object[] { parent, hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 2 };
5950
yield return new object[] { parent, hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 2 };
5951
yield return new object[] { parent, hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
5952
yield return new object[] { parent, hScroll, vScroll, false, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
5978
foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10,
PixelFormat
.Format32bppRgb) })
5998
yield return new object[] { parent, hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, expected1 };
5999
yield return new object[] { parent, hScroll, vScroll, true, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, expected1 };
6000
yield return new object[] { parent, hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, expected1 };
6001
yield return new object[] { parent, hScroll, vScroll, false, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, expected1 };
6002
yield return new object[] { parent, hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, expected2 };
6003
yield return new object[] { parent, hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, expected2 };
6005
yield return new object[] { parent, hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, expected2 };
6006
yield return new object[] { parent, hScroll, vScroll, true, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, expected2 };
6007
yield return new object[] { parent, hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, expected2 };
6008
yield return new object[] { parent, hScroll, vScroll, false, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, expected2 };
6009
yield return new object[] { parent, hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, expected2 };
6010
yield return new object[] { parent, hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, expected2 };
6124
foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10,
PixelFormat
.Format32bppRgb) })
6137
yield return new object[] { hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
6138
yield return new object[] { hScroll, vScroll, true, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
6139
yield return new object[] { hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 1 };
6140
yield return new object[] { hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 1 };
6141
yield return new object[] { hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
6142
yield return new object[] { hScroll, vScroll, false, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.None, 0 };
6144
yield return new object[] { hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
6145
yield return new object[] { hScroll, vScroll, true, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
6146
yield return new object[] { hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
6147
yield return new object[] { hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
6148
yield return new object[] { hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
6149
yield return new object[] { hScroll, vScroll, false, Color.Red, new Bitmap(10, 10,
PixelFormat
.Format32bppArgb), ImageLayout.Tile, 1 };
System.Windows.Forms.UI.IntegrationTests (3)
Infra\ScreenRecordService.cs (2)
248
lockedBitmaps[0] = (frames[0].image, frames[0].image.LockBits(bounds, ImageLockMode.ReadOnly,
PixelFormat
.Format32bppArgb));
267
lockedBitmaps[currentFrameBufferIndex] = (frames[i].image, frames[i].image.LockBits(bounds, ImageLockMode.ReadOnly,
PixelFormat
.Format32bppArgb));
Infra\ScreenshotService.cs (1)
62
Bitmap bitmap = new(width, height,
PixelFormat
.Format32bppArgb);