857 references to PixelFormat
PresentationFramework-SystemDrawing (2)
SystemDrawingExtension.cs (2)
169System.Drawing.Imaging.PixelFormat.Format32bppRgb); 174System.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 (12)
Special\NotSupported.cs (12)
20public Bitmap(int width, int height, System.Drawing.Imaging.PixelFormat format) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 21public Bitmap(int width, int height, int stride, System.Drawing.Imaging.PixelFormat format, System.IntPtr scan0) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 27public System.Drawing.Bitmap Clone(System.Drawing.Rectangle rect, System.Drawing.Imaging.PixelFormat format) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 28public System.Drawing.Bitmap Clone(System.Drawing.RectangleF rect, System.Drawing.Imaging.PixelFormat format) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 38public System.Drawing.Imaging.BitmapData LockBits(System.Drawing.Rectangle rect, System.Drawing.Imaging.ImageLockMode flags, System.Drawing.Imaging.PixelFormat format) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 39public System.Drawing.Imaging.BitmapData LockBits(System.Drawing.Rectangle rect, System.Drawing.Imaging.ImageLockMode flags, System.Drawing.Imaging.PixelFormat format, System.Drawing.Imaging.BitmapData bitmapData) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 759public System.Drawing.Imaging.PixelFormat PixelFormat { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } } 788public static int GetPixelFormatSize(System.Drawing.Imaging.PixelFormat pixfmt) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 791public static bool IsAlphaPixelFormat(System.Drawing.Imaging.PixelFormat pixfmt) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 792public static bool IsCanonicalPixelFormat(System.Drawing.Imaging.PixelFormat pixfmt) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 793public static bool IsExtendedPixelFormat(System.Drawing.Imaging.PixelFormat pixfmt) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1936public System.Drawing.Imaging.PixelFormat PixelFormat { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } set { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } }
System.Drawing.Common.Tests (580)
mono\System.Drawing.Imaging\BmpCodecTests.cs (16)
48Assert.Equal(PixelFormat.Format4bppIndexed, bmp.PixelFormat); 114Assert.Equal(PixelFormat.Format8bppIndexed, bmp.PixelFormat); 180Assert.Equal(PixelFormat.Format24bppRgb, bmp.PixelFormat); 242BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb); 247Assert.Equal(PixelFormat.Format24bppRgb, data.PixelFormat); 384Assert.Equal(PixelFormat.Format32bppRgb, bmp.PixelFormat); 424private void Save(PixelFormat original, PixelFormat expected, bool colorCheck) 468Save(PixelFormat.Format24bppRgb, PixelFormat.Format24bppRgb, true); 474Save(PixelFormat.Format32bppRgb, PixelFormat.Format32bppRgb, true); 480Save(PixelFormat.Format32bppArgb, PixelFormat.Format32bppRgb, true); 486Save(PixelFormat.Format32bppPArgb, PixelFormat.Format32bppRgb, true);
mono\System.Drawing.Imaging\GifCodecTests.cs (13)
45Assert.Equal(PixelFormat.Format8bppIndexed, bmp.PixelFormat); 109BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb); 114Assert.Equal(PixelFormat.Format24bppRgb, data.PixelFormat); 178private void Save(PixelFormat original, PixelFormat expected, bool exactColorCheck) 232Save(PixelFormat.Format24bppRgb, PixelFormat.Format8bppIndexed, false); 238Save(PixelFormat.Format32bppRgb, PixelFormat.Format8bppIndexed, false); 244Save(PixelFormat.Format32bppArgb, PixelFormat.Format8bppIndexed, false); 250Save(PixelFormat.Format32bppPArgb, PixelFormat.Format8bppIndexed, false);
mono\System.Drawing.Imaging\IconCodecTests.cs (28)
45Assert.Equal(PixelFormat.Format32bppArgb, image.PixelFormat); 50Assert.Equal(PixelFormat.Format32bppArgb, bmp.PixelFormat); 74Assert.Equal(PixelFormat.Format32bppArgb, bmp.PixelFormat); 132BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb); 137Assert.Equal(PixelFormat.Format24bppRgb, data.PixelFormat); 222Assert.Equal(PixelFormat.Format32bppArgb, bmp.PixelFormat); 328BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb); 333Assert.Equal(PixelFormat.Format24bppRgb, data.PixelFormat); 427Assert.Equal(PixelFormat.Format32bppArgb, bmp.PixelFormat); 546BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb); 551Assert.Equal(PixelFormat.Format24bppRgb, data.PixelFormat); 649Assert.Equal(PixelFormat.Format32bppArgb, bmp.PixelFormat); 750BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb); 755Assert.Equal(PixelFormat.Format24bppRgb, data.PixelFormat); 907Assert.Equal(PixelFormat.Format32bppArgb, bmp.PixelFormat); 1525BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb); 1530Assert.Equal(PixelFormat.Format24bppRgb, data.PixelFormat); 1841Assert.Equal(PixelFormat.Format32bppArgb, bmp.PixelFormat); 1862private void Save(PixelFormat original, PixelFormat expected, bool colorCheck) 1909Save(PixelFormat.Format24bppRgb, PixelFormat.Format24bppRgb, true); 1915Save(PixelFormat.Format32bppRgb, PixelFormat.Format32bppArgb, true); 1921Save(PixelFormat.Format32bppArgb, PixelFormat.Format32bppArgb, true); 1927Save(PixelFormat.Format32bppPArgb, PixelFormat.Format32bppArgb, true);
mono\System.Drawing.Imaging\JpegCodecTests.cs (16)
47Assert.Equal(PixelFormat.Format8bppIndexed, bmp.PixelFormat); 112BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb); 117Assert.Equal(PixelFormat.Format24bppRgb, data.PixelFormat); 174Assert.Equal(PixelFormat.Format24bppRgb, bmp.PixelFormat); 227BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb); 232Assert.Equal(PixelFormat.Format24bppRgb, data.PixelFormat); 343private void Save(PixelFormat original, PixelFormat expected) 388Save(PixelFormat.Format24bppRgb, PixelFormat.Format24bppRgb); 394Save(PixelFormat.Format32bppRgb, PixelFormat.Format24bppRgb); 400Save(PixelFormat.Format32bppArgb, PixelFormat.Format24bppRgb); 406Save(PixelFormat.Format32bppPArgb, PixelFormat.Format24bppRgb);
mono\System.Drawing.Imaging\PngCodecTests.cs (19)
47Assert.Equal(PixelFormat.Format1bppIndexed, bmp.PixelFormat); 145BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb); 150Assert.Equal(PixelFormat.Format24bppRgb, data.PixelFormat); 250Assert.Equal(PixelFormat.Format32bppArgb, bmp.PixelFormat); 297BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb); 302Assert.Equal(PixelFormat.Format24bppRgb, data.PixelFormat); 357Assert.Equal(PixelFormat.Format4bppIndexed, bmp.PixelFormat); 470BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb); 475Assert.Equal(PixelFormat.Format24bppRgb, data.PixelFormat); 564private void Save(PixelFormat original, PixelFormat expected, bool colorCheck) 608Save(PixelFormat.Format24bppRgb, PixelFormat.Format24bppRgb, true); 614Save(PixelFormat.Format32bppRgb, PixelFormat.Format32bppArgb, true); 620Save(PixelFormat.Format32bppArgb, PixelFormat.Format32bppArgb, true); 626Save(PixelFormat.Format32bppPArgb, PixelFormat.Format32bppArgb, true);
mono\System.Drawing.Imaging\TiffCodecTests.cs (13)
67Assert.Equal(PixelFormat.Format24bppRgb, bmp.PixelFormat); 119BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb); 124Assert.Equal(PixelFormat.Format24bppRgb, data.PixelFormat); 235private void Save(PixelFormat original, PixelFormat expected, bool colorCheck) 279Save(PixelFormat.Format24bppRgb, PixelFormat.Format24bppRgb, true); 285Save(PixelFormat.Format32bppRgb, PixelFormat.Format32bppArgb, true); 291Save(PixelFormat.Format32bppArgb, PixelFormat.Format32bppArgb, true); 297Save(PixelFormat.Format32bppPArgb, PixelFormat.Format32bppArgb, true);
mono\System.Drawing\BitmapTests.cs (64)
48Bitmap bmp = new(100, 100, PixelFormat.Format32bppRgb); 62using Bitmap bmp = new(100, 100, PixelFormat.Format8bppIndexed); 64BitmapData bd = bmp.LockBits(rect, ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb); 71using Bitmap bmp = new(100, 100, PixelFormat.Format32bppRgb); 74bd = bmp.LockBits(rect, ImageLockMode.ReadWrite, PixelFormat.Format8bppIndexed, bd); 89using Bitmap bmp = new(10, 10, PixelFormat.Format24bppRgb); 91BitmapData data = bmp.LockBits(r, 0, PixelFormat.Format24bppRgb); 97Assert.Equal(PixelFormat.Format24bppRgb, data.PixelFormat); 109using Bitmap bmp = new(10, 10, PixelFormat.Format24bppRgb); 111BitmapData data = bmp.LockBits(r, ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb); 114Assert.Throws<InvalidOperationException>(() => bmp.LockBits(r, ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb)); 125using Bitmap bmp = new(1, 1, PixelFormat.Format1bppIndexed); 134using Bitmap bmp = new(1, 1, PixelFormat.Format4bppIndexed); 143using Bitmap bmp = new(1, 1, PixelFormat.Format8bppIndexed); 149private static void FormatTest(PixelFormat format) 164if (format == PixelFormat.Format16bppRgb565) 177if (format == PixelFormat.Format16bppRgb565) 190if (format == PixelFormat.Format32bppPArgb) 221if (format == PixelFormat.Format32bppPArgb) 237case PixelFormat.Format16bppRgb565: 243case PixelFormat.Format16bppArgb1555: 249case PixelFormat.Format16bppRgb555: 263if (format != PixelFormat.Format32bppRgb) 282public void Format32bppArgb() => FormatTest(PixelFormat.Format32bppArgb); 285public void Format32bppRgb() => FormatTest(PixelFormat.Format32bppRgb); 288public void Format24bppRgb() => FormatTest(PixelFormat.Format24bppRgb); 324using Bitmap bmpNew = bmp.Clone(rect, PixelFormat.Format32bppArgb); 378using Bitmap bmp_rotate = src.Clone(new RectangleF(0, 0, width, height), PixelFormat.Format32bppArgb); 400PixelFormat.Format1bppIndexed => 8, 401PixelFormat.Format4bppIndexed => 2, 402PixelFormat.Format8bppIndexed => 1, 460private static Bitmap CreateBitmap(int width, int height, PixelFormat fmt) 506private static byte[] HashLock(Bitmap bmp, int width, int height, PixelFormat fmt, ImageLockMode mode) 563using Bitmap bmp = CreateBitmap(100, 100, PixelFormat.Format32bppArgb); 568byte[] actual = HashLock(bmp, bmp.Width, bmp.Height, PixelFormat.Format32bppArgb, ImageLockMode.ReadWrite); 577using Bitmap bmp = CreateBitmap(100, 100, PixelFormat.Format32bppArgb); 581byte[] actual = HashLock(bmp, bmp.Width, bmp.Height, PixelFormat.Format32bppPArgb, ImageLockMode.ReadWrite); 590using Bitmap bmp = CreateBitmap(100, 100, PixelFormat.Format32bppArgb); 594byte[] actual = HashLock(bmp, bmp.Width, bmp.Height, PixelFormat.Format32bppRgb, ImageLockMode.ReadWrite); 603using Bitmap bmp = CreateBitmap(100, 100, PixelFormat.Format32bppArgb); 607byte[] actual = HashLock(bmp, bmp.Width, bmp.Height, PixelFormat.Format24bppRgb, ImageLockMode.ReadWrite); 619using Bitmap bmp = CreateBitmap(100, 100, PixelFormat.Format32bppArgb); 623byte[] actual = HashLock(bmp, 50, 50, PixelFormat.Format32bppArgb, ImageLockMode.ReadWrite); 632using Bitmap bmp = CreateBitmap(100, 100, PixelFormat.Format32bppArgb); 636byte[] actual = HashLock(bmp, 50, 50, PixelFormat.Format32bppPArgb, ImageLockMode.ReadWrite); 645using Bitmap bmp = CreateBitmap(100, 100, PixelFormat.Format32bppArgb); 649byte[] actual = HashLock(bmp, 50, 50, PixelFormat.Format32bppRgb, ImageLockMode.ReadWrite); 658using Bitmap bmp = CreateBitmap(100, 100, PixelFormat.Format32bppArgb); 662byte[] actual = HashLock(bmp, 50, 50, PixelFormat.Format24bppRgb, ImageLockMode.ReadWrite); 680using (Bitmap bmp = new(1, 1, PixelFormat.Format32bppRgb)) 686data = bmp.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb); 715data = bmp.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb); 735using (Bitmap bmp = new(1, 1, PixelFormat.Format32bppArgb)) 739data = bmp.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb); 759data = bmp.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb); 803Bitmap bmp = new(184, 184, PixelFormat.Format1bppIndexed); 804BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadWrite, PixelFormat.Format1bppIndexed); 825using Bitmap bmp = new(1, 1, PixelFormat.Format1bppIndexed); 859using Bitmap bmp = new(1, 1, PixelFormat.Format4bppIndexed); 1133using Bitmap bmp = new(1, 1, PixelFormat.Format8bppIndexed); 1175public void BitmapIntIntIntPixelFormatIntPtrCtor() => new Bitmap(1, 1, 1, PixelFormat.Format1bppIndexed, nint.Zero); 1182b.PixelFormat.Should().Be(PixelFormat.Format32bppArgb, msg); 1271Assert.Equal(PixelFormat.Format24bppRgb, bitmap.PixelFormat); 1297Assert.Equal(PixelFormat.Format24bppRgb, bitmap.PixelFormat);
mono\System.Drawing\GraphicsTests.cs (1)
349Assert.Equal(PixelFormat.Format4bppIndexed, img.PixelFormat);
mono\System.Imaging\MetafileTest.cs (5)
216using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 233using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 249using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 289using (Bitmap bmp = new(100, 100, PixelFormat.Format32bppArgb)) 331using Bitmap bmp = new(100, 100, PixelFormat.Format32bppArgb);
System\Drawing\BitmapTests.cs (264)
36yield return new object[] { "16x16_one_entry_4bit.ico", 16, 16, PixelFormat.Format32bppArgb, ImageFormat.Icon }; 37yield return new object[] { "bitmap_173x183_indexed_8bit.bmp", 173, 183, PixelFormat.Format8bppIndexed, ImageFormat.Bmp }; 38yield return new object[] { "16x16_nonindexed_24bit.png", 16, 16, PixelFormat.Format24bppRgb, ImageFormat.Png }; 43public void Ctor_FilePath(string filename, int width, int height, PixelFormat pixelFormat, ImageFormat rawFormat) 54public void Ctor_FilePath_UseIcm(string filename, int width, int height, PixelFormat pixelFormat, ImageFormat rawFormat) 90Assert.Equal(PixelFormat.Format8bppIndexed, bitmap.PixelFormat); 118public void Ctor_Stream(string filename, int width, int height, PixelFormat pixelFormat, ImageFormat rawFormat) 130public void Ctor_Stream_UseIcm(string filename, int width, int height, PixelFormat pixelFormat, ImageFormat rawFormat) 167Assert.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)] 186public void Ctor_Width_Height_PixelFormat(int width, int height, PixelFormat pixelFormat) 197yield return new object[] { 10, 10, 0, PixelFormat.Format8bppIndexed, IntPtr.Zero }; 198yield return new object[] { 5, 15, int.MaxValue, PixelFormat.Format32bppArgb, IntPtr.Zero }; 199yield return new object[] { 5, 15, int.MinValue, PixelFormat.Format24bppRgb, IntPtr.Zero }; 200yield return new object[] { 1, 1, 1, PixelFormat.Format1bppIndexed, IntPtr.Zero }; 205public void Ctor_Width_Height_Stride_PixelFormat_Scan0(int width, int height, int stride, PixelFormat pixelFormat, IntPtr scan0) 225AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(width, 1, PixelFormat.Format16bppArgb1555)); 226AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(width, 1, 0, PixelFormat.Format16bppArgb1555, IntPtr.Zero)); 240AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(1, height, PixelFormat.Format16bppArgb1555)); 241AssertExtensions.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)] 255public void Ctor_InvalidPixelFormat_ThrowsArgumentException(PixelFormat format) 264AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(1, 1, 0, PixelFormat.Format16bppArgb1555, 10)); 269yield return new object[] { new Bitmap(1, 1, PixelFormat.Format16bppRgb555), 1, 1 }; 270yield return new object[] { new Bitmap(1, 1, PixelFormat.Format16bppRgb565), 1, 1 }; 271yield return new object[] { new Bitmap(1, 1, PixelFormat.Format24bppRgb), 1, 1 }; 272yield return new object[] { new Bitmap(1, 1, PixelFormat.Format32bppArgb), 1, 1 }; 273yield return new object[] { new Bitmap(1, 1, PixelFormat.Format32bppPArgb), 1, 1 }; 274yield return new object[] { new Bitmap(1, 1, PixelFormat.Format48bppRgb), 1, 1 }; 275yield return new object[] { new Bitmap(1, 1, PixelFormat.Format64bppArgb), 1, 1 }; 276yield return new object[] { new Bitmap(1, 1, PixelFormat.Format64bppPArgb), 1, 1 }; 290Assert.Equal(PixelFormat.Format32bppPArgb, bitmap.PixelFormat); 307Assert.Equal(PixelFormat.Format32bppArgb, bitmap.PixelFormat); 324Assert.Equal(PixelFormat.Format32bppArgb, bitmap.PixelFormat); 335Assert.Equal(PixelFormat.Format32bppArgb, bitmap.PixelFormat); 359yield return new object[] { new Bitmap(3, 3, PixelFormat.Format32bppArgb), new Rectangle(0, 0, 3, 3), PixelFormat.Format32bppArgb }; 360yield return new object[] { new Bitmap(3, 3, PixelFormat.Format32bppArgb), new Rectangle(0, 0, 3, 3), PixelFormat.Format24bppRgb }; 361yield return new object[] { new Bitmap(3, 3, PixelFormat.Format1bppIndexed), new Rectangle(1, 1, 1, 1), PixelFormat.Format64bppArgb }; 362yield return new object[] { new Bitmap(3, 3, PixelFormat.Format64bppPArgb), new Rectangle(1, 1, 1, 1), PixelFormat.Format16bppRgb565 }; 367public void Clone_Rectangle_ReturnsExpected(Bitmap bitmap, Rectangle rectangle, PixelFormat targetFormat) 403public 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)] 453public void Clone_InvalidPixelFormat_ThrowsOutOfMemoryException(PixelFormat format) 463using Bitmap bitmap = new(1, 1, PixelFormat.Format16bppGrayScale); 464Assert.Throws<OutOfMemoryException>(() => bitmap.Clone(new Rectangle(0, 0, 1, 1), PixelFormat.Format32bppArgb)); 465Assert.Throws<OutOfMemoryException>(() => bitmap.Clone(new RectangleF(0, 0, 1, 1), PixelFormat.Format32bppArgb)); 485AssertExtensions.Throws<ArgumentException>(null, () => bitmap.Clone(new Rectangle(0, 0, 1, 1), PixelFormat.Format32bppArgb)); 486AssertExtensions.Throws<ArgumentException>(null, () => bitmap.Clone(new RectangleF(0, 0, 1, 1), PixelFormat.Format32bppArgb)); 532yield return new object[] { new Bitmap(1, 1, PixelFormat.Format1bppIndexed), 0, 0, Color.FromArgb(0, 0, 0) }; 533yield return new object[] { new Bitmap(1, 1, PixelFormat.Format4bppIndexed), 0, 0, Color.FromArgb(0, 0, 0) }; 534yield return new object[] { new Bitmap(1, 1, PixelFormat.Format8bppIndexed), 0, 0, Color.FromArgb(0, 0, 0) }; 535yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), 0, 0, Color.FromArgb(0, 0, 0) }; 536yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), 99, 99, Color.FromArgb(0, 0, 0) }; 574using Bitmap bitmap = new(1, 1, PixelFormat.Format16bppGrayScale); 589yield return new object[] { new Bitmap(1, 1, PixelFormat.Format32bppRgb), 1, 1 }; 590yield return new object[] { new Bitmap(32, 32, PixelFormat.Format32bppArgb), 32, 32 }; 591yield return new object[] { new Bitmap(512, 512, PixelFormat.Format16bppRgb555), 512, 512 }; 606Assert.Equal(PixelFormat.Format32bppRgb, result.PixelFormat); 619Assert.Equal(PixelFormat.Format32bppRgb, result.PixelFormat); 628Assert.Equal(PixelFormat.Format32bppRgb, result.PixelFormat); 639using Bitmap bitmap = new(width, height, PixelFormat.Format16bppGrayScale); 689yield return new object[] { new Bitmap(1, 1, PixelFormat.Format32bppRgb).GetHicon(), 1, 1 }; 690yield return new object[] { new Bitmap(32, 32, PixelFormat.Format32bppRgb).GetHicon(), 32, 32 }; 691yield return new object[] { new Bitmap(512, 512, PixelFormat.Format16bppRgb555).GetHicon(), 512, 512 }; 703Assert.Equal(PixelFormat.Format32bppArgb, result.PixelFormat); 712using Bitmap bitmap = new(1, 1, PixelFormat.Format16bppGrayScale); 892using Bitmap bitmap = new(1, 1, PixelFormat.Format16bppGrayScale); 914yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), 0, 0, Color.FromArgb(255, 128, 128, 128) }; 915yield 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)] 930public void SetPixel_IndexedPixelFormat_ThrowsInvalidOperationException(PixelFormat format) 957using Bitmap bitmap = new(1, 1, PixelFormat.Format16bppGrayScale); 1013Bitmap bitmap() => new(2, 2, PixelFormat.Format32bppArgb); 1014yield return new object[] { bitmap(), new Rectangle(0, 0, 2, 2), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb, 8, 1 }; 1015yield return new object[] { bitmap(), new Rectangle(0, 0, 2, 2), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb, 8, 3 }; 1016yield return new object[] { bitmap(), new Rectangle(0, 0, 2, 2), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb, 8, 2 }; 1018yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadOnly, PixelFormat.Format32bppRgb, 400, 1 }; 1019yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadWrite, PixelFormat.Format32bppRgb, 400, 3 }; 1020yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.WriteOnly, PixelFormat.Format32bppRgb, 400, 2 }; 1022yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb, 300, 65537 }; 1023yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb, 300, 65539 }; 1024yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.WriteOnly, PixelFormat.Format24bppRgb, 300, 65538 }; 1026yield return new object[] { new Bitmap(100, 100, PixelFormat.Format24bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb, 300, 1 }; 1027yield return new object[] { new Bitmap(100, 100, PixelFormat.Format24bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb, 300, 3 }; 1028yield return new object[] { new Bitmap(100, 100, PixelFormat.Format24bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.WriteOnly, PixelFormat.Format24bppRgb, 300, 2 }; 1030yield return new object[] { new Bitmap(100, 100, PixelFormat.Format24bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadOnly, PixelFormat.Format32bppRgb, 400, 65537 }; 1031yield return new object[] { new Bitmap(100, 100, PixelFormat.Format24bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadWrite, PixelFormat.Format32bppRgb, 400, 65539 }; 1032yield return new object[] { new Bitmap(100, 100, PixelFormat.Format24bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.WriteOnly, PixelFormat.Format32bppRgb, 400, 65538 }; 1034yield return new object[] { new Bitmap(100, 100, PixelFormat.Format8bppIndexed), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb, 300, 65537 }; 1036yield return new object[] { new Bitmap(100, 100, PixelFormat.Format8bppIndexed), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadOnly, PixelFormat.Format8bppIndexed, 100, 1 }; 1037yield return new object[] { new Bitmap(100, 100, PixelFormat.Format8bppIndexed), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadWrite, PixelFormat.Format8bppIndexed, 100, 3 }; 1038yield return new object[] { new Bitmap(100, 100, PixelFormat.Format8bppIndexed), new Rectangle(0, 0, 100, 100), ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed, 100, 2 }; 1040yield return new object[] { new Bitmap(184, 184, PixelFormat.Format1bppIndexed), new Rectangle(0, 0, 184, 184), ImageLockMode.ReadOnly, PixelFormat.Format1bppIndexed, 24, 1 }; 1041yield return new object[] { new Bitmap(184, 184, PixelFormat.Format1bppIndexed), new Rectangle(0, 0, 184, 184), ImageLockMode.ReadWrite, PixelFormat.Format1bppIndexed, 24, 3 }; 1042yield return new object[] { new Bitmap(184, 184, PixelFormat.Format1bppIndexed), new Rectangle(0, 0, 184, 184), ImageLockMode.WriteOnly, PixelFormat.Format1bppIndexed, 24, 2 }; 1044yield return new object[] { bitmap(), new Rectangle(1, 1, 1, 1), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb, 8, 1 }; 1045yield return new object[] { bitmap(), new Rectangle(1, 1, 1, 1), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb, 8, 3 }; 1046yield return new object[] { bitmap(), new Rectangle(1, 1, 1, 1), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb, 8, 2 }; 1048yield return new object[] { bitmap(), new Rectangle(1, 1, 1, 1), ImageLockMode.ReadOnly - 1, PixelFormat.Format32bppArgb, 8, 0 }; 1050yield return new object[] { bitmap(), new Rectangle(0, 0, 2, 2), ImageLockMode.WriteOnly, PixelFormat.Format16bppGrayScale, 4, 65538 }; 1052yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadOnly, PixelFormat.Format8bppIndexed, 100, 65537 }; 1053yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadWrite, PixelFormat.Format8bppIndexed, 100, 65539 }; 1054yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed, 100, 65538 }; 1056yield return new object[] { new Bitmap(100, 100, PixelFormat.Format8bppIndexed), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb, 300, 65539 }; 1057yield return new object[] { new Bitmap(100, 100, PixelFormat.Format8bppIndexed), new Rectangle(0, 0, 100, 100), ImageLockMode.WriteOnly, PixelFormat.Format24bppRgb, 300, 65538 }; 1062public void LockBits_Invoke_Success(Bitmap bitmap, Rectangle rectangle, ImageLockMode lockMode, PixelFormat pixelFormat, int expectedStride, int expectedReserved) 1076if (pixelFormat == PixelFormat.Format16bppGrayScale) 1095AssertExtensions.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)] 1129public void LockBits_InvalidPixelFormat_ThrowsArgumentException(PixelFormat format) 1146AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly, PixelFormat.Format16bppGrayScale)); 1147AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly, PixelFormat.Format16bppGrayScale, new BitmapData())); 1149AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadWrite, PixelFormat.Format16bppGrayScale)); 1150AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadWrite, PixelFormat.Format16bppGrayScale, new BitmapData())); 1152BitmapData data = bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.WriteOnly, PixelFormat.Format16bppGrayScale); 1175AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb)); 1178AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb, bitmapData)); 1220[InlineData(PixelFormat.Indexed)] 1221[InlineData(PixelFormat.Gdi)] 1222public 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)] 1283public void CustomPixelFormat_GetPixels_ReturnsExpected(PixelFormat format) 1298if (format == PixelFormat.Format16bppRgb565) 1311if (format == PixelFormat.Format16bppRgb565) 1324if (format == PixelFormat.Format32bppPArgb) 1353if (format == PixelFormat.Format32bppPArgb) 1368case PixelFormat.Format16bppRgb565: 1374case PixelFormat.Format16bppArgb1555: 1380case PixelFormat.Format16bppRgb555: 1396if (format == PixelFormat.Format32bppRgb) 1411if (format == PixelFormat.Format32bppRgb) 1428public 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 } } 1437public void Palette_Get_ReturnsExpected(PixelFormat pixelFormat, int[] expectedEntries) 1468using (Bitmap bitmap = new(1, 1, PixelFormat.Format32bppRgb)) 1474BitmapData data = bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb); 1503data = bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb); 1523using (Bitmap bitmap = new(1, 1, PixelFormat.Format32bppArgb)) 1527BitmapData data = bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb); 1546data = bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb); 1605public 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) }, 1625public 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) }, 1649public void Bitmap_Convert_BasicPixelFormat(PixelFormat format, DitherType dither, PaletteType palette) 1658public void Bitmap_Convert_ArgumentException(PixelFormat format, DitherType dither, PaletteType palette) 1664public static TheoryData<PixelFormat> AllValidPixelFormats { get; } = new() 1666PixelFormat.Format16bppArgb1555, 1667PixelFormat.Format16bppRgb555, 1668PixelFormat.Format16bppRgb565, 1669PixelFormat.Format24bppRgb, 1670PixelFormat.Format32bppArgb, 1671PixelFormat.Format32bppPArgb, 1672PixelFormat.Format32bppRgb, 1673PixelFormat.Format48bppRgb, 1674PixelFormat.Format64bppArgb, 1675PixelFormat.Format64bppPArgb, 1676PixelFormat.Format8bppIndexed, 1677PixelFormat.Format1bppIndexed, 1678PixelFormat.Format4bppIndexed 1683public 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)] 248public void FromImage_Bitmap_Success(PixelFormat format) 262[InlineData(PixelFormat.Format1bppIndexed)] 263[InlineData(PixelFormat.Format4bppIndexed)] 264[InlineData(PixelFormat.Format8bppIndexed)] 265public void FromImage_IndexedImage_ThrowsException(PixelFormat format) 290[InlineData(PixelFormat.Format16bppArgb1555)] 291[InlineData(PixelFormat.Format16bppGrayScale)] 292public void FromImage_Invalid16BitFormat_ThrowsOutOfMemoryException(PixelFormat format) 1916yield return new object[] { PixelFormat.Format32bppArgb, Color.Red, Color.FromArgb(Color.Red.ToArgb()) }; 1917yield return new object[] { PixelFormat.Format16bppRgb555, Color.Red, Color.FromArgb(255, 248, 0, 0) }; 1922public void GetNearestColor_Color_ReturnsExpected(PixelFormat pixelFormat, Color color, Color expected) 2875[InlineData(PixelFormat.Format16bppRgb555, PixelFormat.Format32bppRgb, false)] 2876[InlineData(PixelFormat.Format32bppRgb, PixelFormat.Format16bppRgb555, true)] 2877[InlineData(PixelFormat.Format32bppArgb, PixelFormat.Format16bppRgb555, false)] 2879PixelFormat sourceFormat, 2880PixelFormat destinationFormat, 2903BitmapData data = bitmap.LockBits(default, ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb); 2917BitmapData data = bitmap.LockBits(default, ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
System\Drawing\IconTests.cs (2)
525Assert.Equal(PixelFormat.Format32bppArgb, bitmap.PixelFormat); 563Assert.Equal(PixelFormat.Format32bppArgb, bitmap.PixelFormat);
System\Drawing\ImageTests.cs (30)
568[InlineData(PixelFormat.Format1bppIndexed, 1)] 569[InlineData(PixelFormat.Format4bppIndexed, 4)] 570[InlineData(PixelFormat.Format8bppIndexed, 8)] 571[InlineData(PixelFormat.Format16bppArgb1555, 16)] 572[InlineData(PixelFormat.Format16bppGrayScale, 16)] 573[InlineData(PixelFormat.Format16bppRgb555, 16)] 574[InlineData(PixelFormat.Format16bppRgb565, 16)] 575[InlineData(PixelFormat.Format24bppRgb, 24)] 576[InlineData(PixelFormat.Format32bppArgb, 32)] 577[InlineData(PixelFormat.Format32bppPArgb, 32)] 578[InlineData(PixelFormat.Format32bppRgb, 32)] 579[InlineData(PixelFormat.Format48bppRgb, 48)] 580[InlineData(PixelFormat.Format64bppArgb, 64)] 581[InlineData(PixelFormat.Format64bppPArgb, 64)] 582public void GetPixelFormatSize_ReturnsExpected(PixelFormat format, int expectedSize) 588[InlineData(PixelFormat.Format16bppArgb1555, true)] 589[InlineData(PixelFormat.Format32bppArgb, true)] 590[InlineData(PixelFormat.Format32bppPArgb, true)] 591[InlineData(PixelFormat.Format64bppArgb, true)] 592[InlineData(PixelFormat.Format64bppPArgb, true)] 593[InlineData(PixelFormat.Format16bppGrayScale, false)] 594[InlineData(PixelFormat.Format16bppRgb555, false)] 595[InlineData(PixelFormat.Format16bppRgb565, false)] 596[InlineData(PixelFormat.Format1bppIndexed, false)] 597[InlineData(PixelFormat.Format24bppRgb, false)] 598[InlineData(PixelFormat.Format32bppRgb, false)] 599[InlineData(PixelFormat.Format48bppRgb, false)] 600[InlineData(PixelFormat.Format4bppIndexed, false)] 601[InlineData(PixelFormat.Format8bppIndexed, false)] 602public void IsAlphaPixelFormat_ReturnsExpected(PixelFormat format, bool expected)
System\Drawing\Imaging\BitmapDataTests.cs (25)
17Assert.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)] 108public void PixelFormat_SetValid_ReturnsExpected(PixelFormat pixelFormat) 121Assert.ThrowsAny<ArgumentException>(() => bd.PixelFormat = (PixelFormat)(-1));
System\Drawing\Imaging\MetafileTests.cs (43)
122using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 141using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 168using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 184using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 204using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 214using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 225using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 234using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 244using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 254using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 265using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 301using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 319using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 337using (Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb)) 353using (Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb)) 370using (Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb)) 397using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 408using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 421using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 433using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 446using (Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb)) 462using (Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb)) 478using (Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb)) 495using (Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb)) 513using (Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb)) 530using (Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb)) 546using (Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb)) 562using (Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb)) 579using (Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb)) 597using (Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb)) 635using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 657using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 675using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 692using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 708using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 724using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 735using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 746using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 758using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 771using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 797using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 812using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 824using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb);
System\Drawing\TextureBrushTests.cs (11)
13yield return new object[] { new Bitmap(10, 10), PixelFormat.Format32bppPArgb, new Size(10, 10) }; 14yield return new object[] { new Metafile(Helpers.GetTestBitmapPath("telescope_01.wmf")), PixelFormat.Format32bppArgb, new Size(490, 654) }; 19public void Ctor_Bitmap(Image bitmap, PixelFormat expectedPixelFormat, Size expectedSize) 43Ctor_Bitmap(image, PixelFormat.Format32bppPArgb, new Size(11, 22)); 60public void Ctor_Image_WrapMode(Image image, WrapMode wrapMode, PixelFormat expectedPixelFormat, Size expectedSize) 95Assert.Equal(PixelFormat.Format32bppPArgb, brushImage.PixelFormat); 116Assert.Equal(PixelFormat.Format32bppPArgb, brushImage.PixelFormat); 149Assert.Equal(PixelFormat.Format32bppPArgb, brushImage.PixelFormat); 170Assert.Equal(PixelFormat.Format32bppPArgb, brushImage.PixelFormat); 204Assert.Equal(PixelFormat.Format32bppPArgb, brushImage.PixelFormat); 226Assert.Equal(PixelFormat.Format32bppPArgb, brushImage.PixelFormat);
System.Windows.Forms (6)
System\Windows\Forms\Controls\ImageList\ImageList.cs (4)
573if (bmpData.PixelFormat is not PixelFormat.Format32bppArgb and not PixelFormat.Format32bppRgb) 631result = new Bitmap(_imageSize.Width, _imageSize.Height, PixelFormat.Format32bppArgb); 632targetData = result.LockBits(new Rectangle(0, 0, _imageSize.Width, _imageSize.Height), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (1)
878using Bitmap textBmp = new(textSize.Width, textSize.Height, PixelFormat.Format32bppPArgb);
System\Windows\Forms\Rendering\ControlPaint.cs (1)
270PixelFormat.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)
120s_boxImage = new Bitmap(s_boxImageSize, s_boxImageSize, PixelFormat.Format32bppPArgb); 392PixelFormat.Format32bppPArgb); 425PixelFormat.Format32bppPArgb); 671BitmapData data = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb);
System\Windows\Forms\Design\ImageListImage.cs (1)
42public PixelFormat PixelFormat => Image.PixelFormat;
System.Windows.Forms.Tests (247)
System\Windows\Forms\AxHostTests.cs (2)
1625Assert.Equal(PixelFormat.Format32bppRgb, result.PixelFormat); 1690Assert.Equal(PixelFormat.Format32bppRgb, result.PixelFormat);
System\Windows\Forms\ControlPaintTests.cs (40)
13yield return new object[] { new Bitmap(10, 10, PixelFormat.Format1bppIndexed), Color.Empty }; 14yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppRgb), Color.Empty }; 15yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppArgb), Color.Empty }; 16yield return new object[] { new Bitmap(10, 10, PixelFormat.Format1bppIndexed), Color.Red }; 17yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppRgb), Color.Red }; 18yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppArgb), Color.Red }; 19yield return new object[] { new Bitmap(10, 10, PixelFormat.Format1bppIndexed), Color.Transparent }; 20yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppRgb), Color.Transparent }; 21yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppArgb), Color.Transparent }; 22yield return new object[] { new Bitmap(11, 11, PixelFormat.Format1bppIndexed), Color.Red }; 23yield return new object[] { new Bitmap(11, 11, PixelFormat.Format32bppRgb), Color.Red }; 24yield return new object[] { new Bitmap(11, 11, PixelFormat.Format32bppArgb), Color.Red }; 25yield return new object[] { new Bitmap(16, 24, PixelFormat.Format1bppIndexed), Color.Red }; 26yield return new object[] { new Bitmap(16, 24, PixelFormat.Format32bppRgb), Color.Red }; 27yield return new object[] { new Bitmap(16, 24, PixelFormat.Format32bppArgb), Color.Red }; 41Assert.Equal(PixelFormat.Format16bppRgb555, result.PixelFormat); 66Assert.Equal(PixelFormat.Format16bppRgb555, result.PixelFormat); 89yield return new object[] { new Bitmap(10, 10, PixelFormat.Format1bppIndexed), monochromeMask }; 90yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppRgb), monochromeMask }; 91yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppArgb), monochromeMask }; 92yield return new object[] { new Bitmap(16, 24, PixelFormat.Format1bppIndexed), monochromeMask }; 93yield return new object[] { new Bitmap(16, 24, PixelFormat.Format32bppRgb), monochromeMask }; 94yield return new object[] { new Bitmap(16, 24, PixelFormat.Format32bppArgb), monochromeMask }; 95yield return new object[] { new Bitmap(11, 11, PixelFormat.Format1bppIndexed), monochromeMask }; 96yield return new object[] { new Bitmap(11, 11, PixelFormat.Format32bppRgb), monochromeMask }; 97yield return new object[] { new Bitmap(11, 11, PixelFormat.Format32bppArgb), monochromeMask }; 112Assert.Equal(PixelFormat.Format32bppRgb, result.PixelFormat); 144Assert.Equal(PixelFormat.Format32bppRgb, result.PixelFormat); 177Assert.Equal(PixelFormat.Format32bppRgb, result.PixelFormat); 198yield return new object[] { new Bitmap(10, 10, PixelFormat.Format1bppIndexed) }; 199yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppRgb) }; 200yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppArgb) }; 201yield return new object[] { new Bitmap(16, 24, PixelFormat.Format1bppIndexed) }; 202yield return new object[] { new Bitmap(16, 24, PixelFormat.Format32bppRgb) }; 203yield return new object[] { new Bitmap(16, 24, PixelFormat.Format32bppArgb) }; 204yield return new object[] { new Bitmap(11, 11, PixelFormat.Format1bppIndexed) }; 205yield return new object[] { new Bitmap(11, 11, PixelFormat.Format32bppRgb) }; 206yield return new object[] { new Bitmap(11, 11, PixelFormat.Format32bppArgb) }; 220Assert.Equal(PixelFormat.Format1bppIndexed, result.PixelFormat); 245Assert.Equal(PixelFormat.Format1bppIndexed, result.PixelFormat);
System\Windows\Forms\ControlTests.Handlers.cs (41)
3836foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb), new Bitmap(10, 10, PixelFormat.Format32bppArgb) }) 3899foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb) }) 3912yield return new object[] { parent, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 3913yield return new object[] { parent, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 3914yield return new object[] { parent, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 3915yield return new object[] { parent, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 3916yield return new object[] { parent, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 3917yield return new object[] { parent, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 3919yield return new object[] { parent, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 3920yield return new object[] { parent, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 3921yield return new object[] { parent, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 2 }; 3922yield return new object[] { parent, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 2 }; 3923yield return new object[] { parent, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 3924yield return new object[] { parent, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 3943foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb) }) 3956yield return new object[] { parent, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 3957yield return new object[] { parent, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 3958yield return new object[] { parent, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 3959yield return new object[] { parent, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 3960yield return new object[] { parent, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, expected1 }; 3961yield return new object[] { parent, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, expected1 }; 3963yield return new object[] { parent, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected1 }; 3964yield return new object[] { parent, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected1 }; 3965yield return new object[] { parent, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected1 }; 3966yield return new object[] { parent, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected1 }; 3967yield return new object[] { parent, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected1 }; 3968yield return new object[] { parent, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected1 }; 4071foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb) }) 4084yield return new object[] { true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 4085yield return new object[] { true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 4086yield return new object[] { true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 4087yield return new object[] { true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 4088yield return new object[] { false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 4089yield return new object[] { false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 4091yield return new object[] { true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4092yield return new object[] { true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4093yield return new object[] { true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4094yield return new object[] { true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4095yield return new object[] { false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4096yield return new object[] { false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 };
System\Windows\Forms\ControlTests.Properties.cs (10)
2039yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, false }; 2040yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, false }; 2041yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Center, true }; 2042yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Stretch, true }; 2043yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Zoom, true }; 2045yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppRgb), ImageLayout.None, false }; 2046yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppRgb), ImageLayout.Tile, false }; 2047yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppRgb), ImageLayout.Center, false }; 2048yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppRgb), ImageLayout.Stretch, false }; 2049yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppRgb), ImageLayout.Zoom, false };
System\Windows\Forms\DataObject_BitmapBinderTests.cs (2)
69BitmapData originalData = bitmap.LockBits(default, ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb); 70BitmapData deserializedData = deserializedBitmap.LockBits(default, ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
System\Windows\Forms\ImageList.ImageCollectionTests.cs (42)
50using Bitmap image1bppIndexed = new(1, 2, PixelFormat.Format24bppRgb); 51using Bitmap image24bppRGb = new(3, 4, PixelFormat.Format24bppRgb); 52using Bitmap image32bppRGb = new(5, 6, PixelFormat.Format32bppRgb); 53using Bitmap image32bppArgbNotTransparent = new(7, 8, PixelFormat.Format32bppArgb); 54using Bitmap image32bppArgbTransparent = new(9, 10, PixelFormat.Format32bppArgb); 66Assert.Equal(PixelFormat.Format32bppArgb, bitmap1.PixelFormat); 71Assert.Equal(PixelFormat.Format32bppArgb, bitmap2.PixelFormat); 76Assert.Equal(PixelFormat.Format32bppArgb, bitmap3.PixelFormat); 81Assert.Equal(PixelFormat.Format32bppArgb, bitmap4.PixelFormat); 86Assert.Equal(PixelFormat.Format32bppArgb, bitmap5.PixelFormat); 98using Bitmap image1bppIndexed = new(1, 2, PixelFormat.Format24bppRgb); 99using Bitmap image24bppRGb = new(3, 4, PixelFormat.Format24bppRgb); 100using Bitmap image32bppRGb = new(5, 6, PixelFormat.Format32bppRgb); 101using Bitmap image32bppArgbNotTransparent = new(7, 8, PixelFormat.Format32bppArgb); 102using Bitmap image32bppArgbTransparent = new(9, 10, PixelFormat.Format32bppArgb); 114Assert.Equal(PixelFormat.Format32bppArgb, bitmap1.PixelFormat); 119Assert.Equal(PixelFormat.Format32bppArgb, bitmap2.PixelFormat); 124Assert.Equal(PixelFormat.Format32bppArgb, bitmap3.PixelFormat); 129Assert.Equal(PixelFormat.Format32bppArgb, bitmap4.PixelFormat); 134Assert.Equal(PixelFormat.Format32bppArgb, bitmap5.PixelFormat); 142PixelFormat.Format1bppIndexed, 143PixelFormat.Format24bppRgb, 144PixelFormat.Format32bppRgb, 145PixelFormat.Format32bppArgb, 146PixelFormat.Format32bppPArgb, 151foreach (PixelFormat pixelFormat in pixelFormats) 154yield return new object[] { PixelFormat.Format24bppRgb, Color.Red, Color.FromArgb(200, 50, 75, 100) }; 161yield return new object[] { PixelFormat.Format1bppIndexed, Color.Empty, Color.Empty, Color.FromArgb(255, 0, 0, 0) }; 167yield return new object[] { PixelFormat.Format24bppRgb, Color.Red, Color.FromArgb(200, 50, 75, 100), Color.FromArgb(255, 50, 75, 100) }; 168yield return new object[] { PixelFormat.Format32bppRgb, Color.Red, Color.FromArgb(200, 50, 75, 100), Color.FromArgb(255, 50, 75, 100) }; 184public void ImageCollection_Item_Get32bppColorDepth_Success(PixelFormat pixelFormat, Color pixel00Color, Color givenPixel10Color, Color expectedPixel10Color) 210Assert.Equal(PixelFormat.Format32bppArgb, resultImage.PixelFormat); 273Assert.Equal(PixelFormat.Format32bppArgb, bitmap.PixelFormat); 294Assert.Equal(PixelFormat.Format32bppArgb, bitmap.PixelFormat); 360Assert.Equal(PixelFormat.Format32bppArgb, result1.PixelFormat); 367Assert.Equal(PixelFormat.Format32bppArgb, result1.PixelFormat); 1172Assert.Equal(PixelFormat.Format32bppArgb, result1.PixelFormat); 1178Assert.Equal(PixelFormat.Format32bppArgb, result2.PixelFormat); 1210Assert.Equal(PixelFormat.Format32bppArgb, result1.PixelFormat); 1216Assert.Equal(PixelFormat.Format32bppArgb, result2.PixelFormat); 1646Assert.Equal(PixelFormat.Format32bppArgb, bitmap.PixelFormat); 1667Assert.Equal(PixelFormat.Format32bppArgb, bitmap.PixelFormat);
System\Windows\Forms\ScrollableControlTests.cs (41)
1510foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb), new Bitmap(10, 10, PixelFormat.Format32bppArgb) }) 1582foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb) }) 1596yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 1597yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 1598yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 1599yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 1600yield return new object[] { parentFactory(), hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 1601yield return new object[] { parentFactory(), hScroll, vScroll, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 1603yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 1604yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 1605yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 2 }; 1606yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 2 }; 1607yield return new object[] { parentFactory(), hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 1608yield return new object[] { parentFactory(), hScroll, vScroll, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 1626foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb) }) 1646yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 1647yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 1648yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, expected1 }; 1649yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, expected1 }; 1650yield return new object[] { parentFactory(), hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 1651yield return new object[] { parentFactory(), hScroll, vScroll, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 1653yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected1 }; 1654yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected1 }; 1655yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected1 }; 1656yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected1 }; 1657yield return new object[] { parentFactory(), hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected1 }; 1658yield return new object[] { parentFactory(), hScroll, vScroll, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected1 }; 1782foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb) }) 1796yield return new object[] { hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 1797yield return new object[] { hScroll, vScroll, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 1798yield return new object[] { hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 1799yield return new object[] { hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 1800yield return new object[] { hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 1801yield return new object[] { hScroll, vScroll, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 1803yield return new object[] { hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 1804yield return new object[] { hScroll, vScroll, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 1805yield return new object[] { hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 1806yield return new object[] { hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 1807yield return new object[] { hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 1808yield return new object[] { hScroll, vScroll, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 };
System\Windows\Forms\TabPageTests.cs (28)
3958foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb), new Bitmap(10, 10, PixelFormat.Format32bppArgb) }) 4012foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb) }) 4025yield return new object[] { appearance, useVisualStyleBackColor, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 4026yield return new object[] { appearance, useVisualStyleBackColor, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 4027yield return new object[] { appearance, useVisualStyleBackColor, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 4028yield return new object[] { appearance, useVisualStyleBackColor, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 4029yield return new object[] { appearance, useVisualStyleBackColor, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 4030yield return new object[] { appearance, useVisualStyleBackColor, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 4032yield return new object[] { appearance, useVisualStyleBackColor, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4033yield return new object[] { appearance, useVisualStyleBackColor, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4034yield return new object[] { appearance, useVisualStyleBackColor, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4035yield return new object[] { appearance, useVisualStyleBackColor, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4036yield return new object[] { appearance, useVisualStyleBackColor, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4037yield return new object[] { appearance, useVisualStyleBackColor, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4151foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb) }) 4164yield return new object[] { appearance, useVisualStyleBackColor, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 4165yield return new object[] { appearance, useVisualStyleBackColor, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 4166yield return new object[] { appearance, useVisualStyleBackColor, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 4167yield return new object[] { appearance, useVisualStyleBackColor, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 4168yield return new object[] { appearance, useVisualStyleBackColor, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 4169yield return new object[] { appearance, useVisualStyleBackColor, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 4171yield return new object[] { appearance, useVisualStyleBackColor, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4172yield return new object[] { appearance, useVisualStyleBackColor, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4173yield return new object[] { appearance, useVisualStyleBackColor, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4174yield return new object[] { appearance, useVisualStyleBackColor, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4175yield return new object[] { appearance, useVisualStyleBackColor, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4176yield return new object[] { appearance, useVisualStyleBackColor, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 };
System\Windows\Forms\ToolStripTests.cs (41)
5851foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb), new Bitmap(10, 10, PixelFormat.Format32bppArgb) }) 5924foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb) }) 5938yield return new object[] { parent, hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 5939yield return new object[] { parent, hScroll, vScroll, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 5940yield return new object[] { parent, hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 5941yield return new object[] { parent, hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 5942yield return new object[] { parent, hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 5943yield return new object[] { parent, hScroll, vScroll, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 5945yield return new object[] { parent, hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 5946yield return new object[] { parent, hScroll, vScroll, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 5947yield return new object[] { parent, hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 2 }; 5948yield return new object[] { parent, hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 2 }; 5949yield return new object[] { parent, hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 5950yield return new object[] { parent, hScroll, vScroll, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 5976foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb) }) 5996yield return new object[] { parent, hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, expected1 }; 5997yield return new object[] { parent, hScroll, vScroll, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, expected1 }; 5998yield return new object[] { parent, hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, expected1 }; 5999yield return new object[] { parent, hScroll, vScroll, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, expected1 }; 6000yield return new object[] { parent, hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, expected2 }; 6001yield return new object[] { parent, hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, expected2 }; 6003yield return new object[] { parent, hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected2 }; 6004yield return new object[] { parent, hScroll, vScroll, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected2 }; 6005yield return new object[] { parent, hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected2 }; 6006yield return new object[] { parent, hScroll, vScroll, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected2 }; 6007yield return new object[] { parent, hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected2 }; 6008yield return new object[] { parent, hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected2 }; 6122foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb) }) 6135yield return new object[] { hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 6136yield return new object[] { hScroll, vScroll, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 6137yield return new object[] { hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 6138yield return new object[] { hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 6139yield return new object[] { hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 6140yield return new object[] { hScroll, vScroll, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 6142yield return new object[] { hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 6143yield return new object[] { hScroll, vScroll, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 6144yield return new object[] { hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 6145yield return new object[] { hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 6146yield return new object[] { hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 6147yield 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)
248lockedBitmaps[0] = (frames[0].image, frames[0].image.LockBits(bounds, ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb)); 267lockedBitmaps[currentFrameBufferIndex] = (frames[i].image, frames[i].image.LockBits(bounds, ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb));
Infra\ScreenshotService.cs (1)
62Bitmap bitmap = new(width, height, PixelFormat.Format32bppArgb);