856 references to PixelFormat
PresentationFramework-SystemDrawing (2)
SystemDrawingExtension.cs (2)
125Bitmap bitmapFinal = new(imageWidth, imageHeight, PixelFormat.Format32bppRgb); 130PixelFormat.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 static 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 static 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 static 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)
49Assert.Equal(PixelFormat.Format8bppIndexed, bmp.PixelFormat); 114BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb); 119Assert.Equal(PixelFormat.Format24bppRgb, data.PixelFormat); 176Assert.Equal(PixelFormat.Format24bppRgb, bmp.PixelFormat); 229BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb); 234Assert.Equal(PixelFormat.Format24bppRgb, data.PixelFormat); 345private static void Save(PixelFormat original, PixelFormat expected) 390Save(PixelFormat.Format24bppRgb, PixelFormat.Format24bppRgb); 396Save(PixelFormat.Format32bppRgb, PixelFormat.Format24bppRgb); 402Save(PixelFormat.Format32bppArgb, PixelFormat.Format24bppRgb); 408Save(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 static 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 static 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); 321using Bitmap bmpNew = bmp.Clone(rect, PixelFormat.Format32bppArgb); 375using Bitmap bmp_rotate = src.Clone(new RectangleF(0, 0, width, height), PixelFormat.Format32bppArgb); 397PixelFormat.Format1bppIndexed => 8, 398PixelFormat.Format4bppIndexed => 2, 399PixelFormat.Format8bppIndexed => 1, 454private static Bitmap CreateBitmap(int width, int height, PixelFormat fmt) 500private static byte[] HashLock(Bitmap bmp, int width, int height, PixelFormat fmt, ImageLockMode mode) 557using Bitmap bmp = CreateBitmap(100, 100, PixelFormat.Format32bppArgb); 562byte[] actual = HashLock(bmp, bmp.Width, bmp.Height, PixelFormat.Format32bppArgb, ImageLockMode.ReadWrite); 571using Bitmap bmp = CreateBitmap(100, 100, PixelFormat.Format32bppArgb); 575byte[] actual = HashLock(bmp, bmp.Width, bmp.Height, PixelFormat.Format32bppPArgb, ImageLockMode.ReadWrite); 584using Bitmap bmp = CreateBitmap(100, 100, PixelFormat.Format32bppArgb); 588byte[] actual = HashLock(bmp, bmp.Width, bmp.Height, PixelFormat.Format32bppRgb, ImageLockMode.ReadWrite); 597using Bitmap bmp = CreateBitmap(100, 100, PixelFormat.Format32bppArgb); 601byte[] actual = HashLock(bmp, bmp.Width, bmp.Height, PixelFormat.Format24bppRgb, ImageLockMode.ReadWrite); 613using Bitmap bmp = CreateBitmap(100, 100, PixelFormat.Format32bppArgb); 617byte[] actual = HashLock(bmp, 50, 50, PixelFormat.Format32bppArgb, ImageLockMode.ReadWrite); 626using Bitmap bmp = CreateBitmap(100, 100, PixelFormat.Format32bppArgb); 630byte[] actual = HashLock(bmp, 50, 50, PixelFormat.Format32bppPArgb, ImageLockMode.ReadWrite); 639using Bitmap bmp = CreateBitmap(100, 100, PixelFormat.Format32bppArgb); 643byte[] actual = HashLock(bmp, 50, 50, PixelFormat.Format32bppRgb, ImageLockMode.ReadWrite); 652using Bitmap bmp = CreateBitmap(100, 100, PixelFormat.Format32bppArgb); 656byte[] actual = HashLock(bmp, 50, 50, PixelFormat.Format24bppRgb, ImageLockMode.ReadWrite); 674using (Bitmap bmp = new(1, 1, PixelFormat.Format32bppRgb)) 680data = bmp.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb); 709data = bmp.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb); 729using (Bitmap bmp = new(1, 1, PixelFormat.Format32bppArgb)) 733data = bmp.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb); 753data = bmp.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb); 797Bitmap bmp = new(184, 184, PixelFormat.Format1bppIndexed); 798BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadWrite, PixelFormat.Format1bppIndexed); 819using Bitmap bmp = new(1, 1, PixelFormat.Format1bppIndexed); 853using Bitmap bmp = new(1, 1, PixelFormat.Format4bppIndexed); 1127using Bitmap bmp = new(1, 1, PixelFormat.Format8bppIndexed); 1169public void BitmapIntIntIntPixelFormatIntPtrCtor() => new Bitmap(1, 1, 1, PixelFormat.Format1bppIndexed, nint.Zero); 1176b.PixelFormat.Should().Be(PixelFormat.Format32bppArgb, msg); 1265Assert.Equal(PixelFormat.Format24bppRgb, bitmap.PixelFormat); 1291Assert.Equal(PixelFormat.Format24bppRgb, bitmap.PixelFormat);
mono\System.Drawing\GraphicsTests.cs (1)
346Assert.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)
35yield return new object[] { "16x16_one_entry_4bit.ico", 16, 16, PixelFormat.Format32bppArgb, ImageFormat.Icon }; 36yield return new object[] { "bitmap_173x183_indexed_8bit.bmp", 173, 183, PixelFormat.Format8bppIndexed, ImageFormat.Bmp }; 37yield return new object[] { "16x16_nonindexed_24bit.png", 16, 16, PixelFormat.Format24bppRgb, ImageFormat.Png }; 42public void Ctor_FilePath(string filename, int width, int height, PixelFormat pixelFormat, ImageFormat rawFormat) 53public void Ctor_FilePath_UseIcm(string filename, int width, int height, PixelFormat pixelFormat, ImageFormat rawFormat) 89Assert.Equal(PixelFormat.Format8bppIndexed, bitmap.PixelFormat); 117public void Ctor_Stream(string filename, int width, int height, PixelFormat pixelFormat, ImageFormat rawFormat) 129public void Ctor_Stream_UseIcm(string filename, int width, int height, PixelFormat pixelFormat, ImageFormat rawFormat) 166Assert.Equal(PixelFormat.Format32bppArgb, bitmap.PixelFormat); 171[InlineData(10, 10, PixelFormat.Format1bppIndexed)] 172[InlineData(10, 10, PixelFormat.Format8bppIndexed)] 173[InlineData(1, 1, PixelFormat.Format16bppArgb1555)] 174[InlineData(1, 1, PixelFormat.Format16bppRgb555)] 175[InlineData(1, 1, PixelFormat.Format16bppRgb565)] 176[InlineData(1, 1, PixelFormat.Format16bppGrayScale)] 177[InlineData(1, 1, PixelFormat.Format24bppRgb)] 178[InlineData(1, 1, PixelFormat.Format32bppRgb)] 179[InlineData(5, 15, PixelFormat.Format32bppArgb)] 180[InlineData(1, 1, PixelFormat.Format32bppPArgb)] 181[InlineData(10, 10, PixelFormat.Format48bppRgb)] 182[InlineData(10, 10, PixelFormat.Format4bppIndexed)] 183[InlineData(1, 1, PixelFormat.Format64bppArgb)] 184[InlineData(1, 1, PixelFormat.Format64bppPArgb)] 185public void Ctor_Width_Height_PixelFormat(int width, int height, PixelFormat pixelFormat) 196yield return new object[] { 10, 10, 0, PixelFormat.Format8bppIndexed, IntPtr.Zero }; 197yield return new object[] { 5, 15, int.MaxValue, PixelFormat.Format32bppArgb, IntPtr.Zero }; 198yield return new object[] { 5, 15, int.MinValue, PixelFormat.Format24bppRgb, IntPtr.Zero }; 199yield return new object[] { 1, 1, 1, PixelFormat.Format1bppIndexed, IntPtr.Zero }; 204public void Ctor_Width_Height_Stride_PixelFormat_Scan0(int width, int height, int stride, PixelFormat pixelFormat, IntPtr scan0) 224AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(width, 1, PixelFormat.Format16bppArgb1555)); 225AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(width, 1, 0, PixelFormat.Format16bppArgb1555, IntPtr.Zero)); 239AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(1, height, PixelFormat.Format16bppArgb1555)); 240AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(1, height, 0, PixelFormat.Format16bppArgb1555, IntPtr.Zero)); 244[InlineData(PixelFormat.Undefined - 1)] 245[InlineData(PixelFormat.Undefined)] 246[InlineData(PixelFormat.Gdi - 1)] 247[InlineData(PixelFormat.Max)] 248[InlineData(PixelFormat.Indexed)] 249[InlineData(PixelFormat.Gdi)] 250[InlineData(PixelFormat.Alpha)] 251[InlineData(PixelFormat.PAlpha)] 252[InlineData(PixelFormat.Extended)] 253[InlineData(PixelFormat.Canonical)] 254public void Ctor_InvalidPixelFormat_ThrowsArgumentException(PixelFormat format) 263AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(1, 1, 0, PixelFormat.Format16bppArgb1555, 10)); 268yield return new object[] { new Bitmap(1, 1, PixelFormat.Format16bppRgb555), 1, 1 }; 269yield return new object[] { new Bitmap(1, 1, PixelFormat.Format16bppRgb565), 1, 1 }; 270yield return new object[] { new Bitmap(1, 1, PixelFormat.Format24bppRgb), 1, 1 }; 271yield return new object[] { new Bitmap(1, 1, PixelFormat.Format32bppArgb), 1, 1 }; 272yield return new object[] { new Bitmap(1, 1, PixelFormat.Format32bppPArgb), 1, 1 }; 273yield return new object[] { new Bitmap(1, 1, PixelFormat.Format48bppRgb), 1, 1 }; 274yield return new object[] { new Bitmap(1, 1, PixelFormat.Format64bppArgb), 1, 1 }; 275yield return new object[] { new Bitmap(1, 1, PixelFormat.Format64bppPArgb), 1, 1 }; 289Assert.Equal(PixelFormat.Format32bppPArgb, bitmap.PixelFormat); 306Assert.Equal(PixelFormat.Format32bppArgb, bitmap.PixelFormat); 323Assert.Equal(PixelFormat.Format32bppArgb, bitmap.PixelFormat); 334Assert.Equal(PixelFormat.Format32bppArgb, bitmap.PixelFormat); 358yield return new object[] { new Bitmap(3, 3, PixelFormat.Format32bppArgb), new Rectangle(0, 0, 3, 3), PixelFormat.Format32bppArgb }; 359yield return new object[] { new Bitmap(3, 3, PixelFormat.Format32bppArgb), new Rectangle(0, 0, 3, 3), PixelFormat.Format24bppRgb }; 360yield return new object[] { new Bitmap(3, 3, PixelFormat.Format1bppIndexed), new Rectangle(1, 1, 1, 1), PixelFormat.Format64bppArgb }; 361yield return new object[] { new Bitmap(3, 3, PixelFormat.Format64bppPArgb), new Rectangle(1, 1, 1, 1), PixelFormat.Format16bppRgb565 }; 366public void Clone_Rectangle_ReturnsExpected(Bitmap bitmap, Rectangle rectangle, PixelFormat targetFormat) 402public void Clone_RectangleF_ReturnsExpected(Bitmap bitmap, Rectangle rectangle, PixelFormat format) 444[InlineData(PixelFormat.Max)] 445[InlineData(PixelFormat.Indexed)] 446[InlineData(PixelFormat.Gdi)] 447[InlineData(PixelFormat.Alpha)] 448[InlineData(PixelFormat.PAlpha)] 449[InlineData(PixelFormat.Extended)] 450[InlineData(PixelFormat.Format16bppGrayScale)] 451[InlineData(PixelFormat.Canonical)] 452public void Clone_InvalidPixelFormat_ThrowsExternalException(PixelFormat format) 462using Bitmap bitmap = new(1, 1, PixelFormat.Format16bppGrayScale); 463Assert.Throws<ExternalException>(() => bitmap.Clone(new Rectangle(0, 0, 1, 1), PixelFormat.Format32bppArgb)); 464Assert.Throws<ExternalException>(() => bitmap.Clone(new RectangleF(0, 0, 1, 1), PixelFormat.Format32bppArgb)); 484AssertExtensions.Throws<ArgumentException>(null, () => bitmap.Clone(new Rectangle(0, 0, 1, 1), PixelFormat.Format32bppArgb)); 485AssertExtensions.Throws<ArgumentException>(null, () => bitmap.Clone(new RectangleF(0, 0, 1, 1), PixelFormat.Format32bppArgb)); 531yield return new object[] { new Bitmap(1, 1, PixelFormat.Format1bppIndexed), 0, 0, Color.FromArgb(0, 0, 0) }; 532yield return new object[] { new Bitmap(1, 1, PixelFormat.Format4bppIndexed), 0, 0, Color.FromArgb(0, 0, 0) }; 533yield return new object[] { new Bitmap(1, 1, PixelFormat.Format8bppIndexed), 0, 0, Color.FromArgb(0, 0, 0) }; 534yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), 0, 0, Color.FromArgb(0, 0, 0) }; 535yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), 99, 99, Color.FromArgb(0, 0, 0) }; 573using Bitmap bitmap = new(1, 1, PixelFormat.Format16bppGrayScale); 588yield return new object[] { new Bitmap(1, 1, PixelFormat.Format32bppRgb), 1, 1 }; 589yield return new object[] { new Bitmap(32, 32, PixelFormat.Format32bppArgb), 32, 32 }; 590yield return new object[] { new Bitmap(512, 512, PixelFormat.Format16bppRgb555), 512, 512 }; 605Assert.Equal(PixelFormat.Format32bppRgb, result.PixelFormat); 618Assert.Equal(PixelFormat.Format32bppRgb, result.PixelFormat); 627Assert.Equal(PixelFormat.Format32bppRgb, result.PixelFormat); 638using Bitmap bitmap = new(width, height, PixelFormat.Format16bppGrayScale); 688yield return new object[] { new Bitmap(1, 1, PixelFormat.Format32bppRgb).GetHicon(), 1, 1 }; 689yield return new object[] { new Bitmap(32, 32, PixelFormat.Format32bppRgb).GetHicon(), 32, 32 }; 690yield return new object[] { new Bitmap(512, 512, PixelFormat.Format16bppRgb555).GetHicon(), 512, 512 }; 702Assert.Equal(PixelFormat.Format32bppArgb, result.PixelFormat); 711using Bitmap bitmap = new(1, 1, PixelFormat.Format16bppGrayScale); 891using Bitmap bitmap = new(1, 1, PixelFormat.Format16bppGrayScale); 913yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), 0, 0, Color.FromArgb(255, 128, 128, 128) }; 914yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), 99, 99, Color.FromArgb(255, 128, 128, 128) }; 926[InlineData(PixelFormat.Format1bppIndexed)] 927[InlineData(PixelFormat.Format4bppIndexed)] 928[InlineData(PixelFormat.Format8bppIndexed)] 929public void SetPixel_IndexedPixelFormat_ThrowsInvalidOperationException(PixelFormat format) 956using Bitmap bitmap = new(1, 1, PixelFormat.Format16bppGrayScale); 1012static Bitmap bitmap() => new(2, 2, PixelFormat.Format32bppArgb); 1013yield return new object[] { bitmap(), new Rectangle(0, 0, 2, 2), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb, 8, 1 }; 1014yield return new object[] { bitmap(), new Rectangle(0, 0, 2, 2), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb, 8, 3 }; 1015yield return new object[] { bitmap(), new Rectangle(0, 0, 2, 2), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb, 8, 2 }; 1017yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadOnly, PixelFormat.Format32bppRgb, 400, 1 }; 1018yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadWrite, PixelFormat.Format32bppRgb, 400, 3 }; 1019yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.WriteOnly, PixelFormat.Format32bppRgb, 400, 2 }; 1021yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb, 300, 65537 }; 1022yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb, 300, 65539 }; 1023yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.WriteOnly, PixelFormat.Format24bppRgb, 300, 65538 }; 1025yield return new object[] { new Bitmap(100, 100, PixelFormat.Format24bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb, 300, 1 }; 1026yield return new object[] { new Bitmap(100, 100, PixelFormat.Format24bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb, 300, 3 }; 1027yield return new object[] { new Bitmap(100, 100, PixelFormat.Format24bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.WriteOnly, PixelFormat.Format24bppRgb, 300, 2 }; 1029yield return new object[] { new Bitmap(100, 100, PixelFormat.Format24bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadOnly, PixelFormat.Format32bppRgb, 400, 65537 }; 1030yield return new object[] { new Bitmap(100, 100, PixelFormat.Format24bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadWrite, PixelFormat.Format32bppRgb, 400, 65539 }; 1031yield return new object[] { new Bitmap(100, 100, PixelFormat.Format24bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.WriteOnly, PixelFormat.Format32bppRgb, 400, 65538 }; 1033yield return new object[] { new Bitmap(100, 100, PixelFormat.Format8bppIndexed), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb, 300, 65537 }; 1035yield return new object[] { new Bitmap(100, 100, PixelFormat.Format8bppIndexed), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadOnly, PixelFormat.Format8bppIndexed, 100, 1 }; 1036yield return new object[] { new Bitmap(100, 100, PixelFormat.Format8bppIndexed), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadWrite, PixelFormat.Format8bppIndexed, 100, 3 }; 1037yield return new object[] { new Bitmap(100, 100, PixelFormat.Format8bppIndexed), new Rectangle(0, 0, 100, 100), ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed, 100, 2 }; 1039yield return new object[] { new Bitmap(184, 184, PixelFormat.Format1bppIndexed), new Rectangle(0, 0, 184, 184), ImageLockMode.ReadOnly, PixelFormat.Format1bppIndexed, 24, 1 }; 1040yield return new object[] { new Bitmap(184, 184, PixelFormat.Format1bppIndexed), new Rectangle(0, 0, 184, 184), ImageLockMode.ReadWrite, PixelFormat.Format1bppIndexed, 24, 3 }; 1041yield return new object[] { new Bitmap(184, 184, PixelFormat.Format1bppIndexed), new Rectangle(0, 0, 184, 184), ImageLockMode.WriteOnly, PixelFormat.Format1bppIndexed, 24, 2 }; 1043yield return new object[] { bitmap(), new Rectangle(1, 1, 1, 1), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb, 8, 1 }; 1044yield return new object[] { bitmap(), new Rectangle(1, 1, 1, 1), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb, 8, 3 }; 1045yield return new object[] { bitmap(), new Rectangle(1, 1, 1, 1), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb, 8, 2 }; 1047yield return new object[] { bitmap(), new Rectangle(1, 1, 1, 1), ImageLockMode.ReadOnly - 1, PixelFormat.Format32bppArgb, 8, 0 }; 1049yield return new object[] { bitmap(), new Rectangle(0, 0, 2, 2), ImageLockMode.WriteOnly, PixelFormat.Format16bppGrayScale, 4, 65538 }; 1051yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadOnly, PixelFormat.Format8bppIndexed, 100, 65537 }; 1052yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadWrite, PixelFormat.Format8bppIndexed, 100, 65539 }; 1053yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), new Rectangle(0, 0, 100, 100), ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed, 100, 65538 }; 1055yield return new object[] { new Bitmap(100, 100, PixelFormat.Format8bppIndexed), new Rectangle(0, 0, 100, 100), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb, 300, 65539 }; 1056yield return new object[] { new Bitmap(100, 100, PixelFormat.Format8bppIndexed), new Rectangle(0, 0, 100, 100), ImageLockMode.WriteOnly, PixelFormat.Format24bppRgb, 300, 65538 }; 1061public void LockBits_Invoke_Success(Bitmap bitmap, Rectangle rectangle, ImageLockMode lockMode, PixelFormat pixelFormat, int expectedStride, int expectedReserved) 1075if (pixelFormat == PixelFormat.Format16bppGrayScale) 1094AssertExtensions.Throws<ArgumentNullException>("bitmapData", () => bitmap.LockBits(Rectangle.Empty, ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb, null)); 1120[InlineData(PixelFormat.DontCare)] 1121[InlineData(PixelFormat.Max)] 1122[InlineData(PixelFormat.Indexed)] 1123[InlineData(PixelFormat.Gdi)] 1124[InlineData(PixelFormat.Alpha)] 1125[InlineData(PixelFormat.PAlpha)] 1126[InlineData(PixelFormat.Extended)] 1127[InlineData(PixelFormat.Canonical)] 1128public void LockBits_InvalidPixelFormat_ThrowsArgumentException(PixelFormat format) 1145AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly, PixelFormat.Format16bppGrayScale)); 1146AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly, PixelFormat.Format16bppGrayScale, new BitmapData())); 1148AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadWrite, PixelFormat.Format16bppGrayScale)); 1149AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadWrite, PixelFormat.Format16bppGrayScale, new BitmapData())); 1151BitmapData data = bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.WriteOnly, PixelFormat.Format16bppGrayScale); 1174AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb)); 1177AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb, bitmapData)); 1219[InlineData(PixelFormat.Indexed)] 1220[InlineData(PixelFormat.Gdi)] 1221public void UnlockBits_InvalidPixelFormat_Nop(PixelFormat format) 1275[InlineData(PixelFormat.Format16bppArgb1555)] 1276[InlineData(PixelFormat.Format16bppRgb555)] 1277[InlineData(PixelFormat.Format16bppRgb565)] 1278[InlineData(PixelFormat.Format32bppArgb)] 1279[InlineData(PixelFormat.Format32bppPArgb)] 1280[InlineData(PixelFormat.Format32bppRgb)] 1281[InlineData(PixelFormat.Format24bppRgb)] 1282public void CustomPixelFormat_GetPixels_ReturnsExpected(PixelFormat format) 1297if (format == PixelFormat.Format16bppRgb565) 1310if (format == PixelFormat.Format16bppRgb565) 1323if (format == PixelFormat.Format32bppPArgb) 1352if (format == PixelFormat.Format32bppPArgb) 1367case PixelFormat.Format16bppRgb565: 1373case PixelFormat.Format16bppArgb1555: 1379case PixelFormat.Format16bppRgb555: 1395if (format == PixelFormat.Format32bppRgb) 1410if (format == PixelFormat.Format32bppRgb) 1427public static TheoryData<PixelFormat, int[]> Palette_TestData => new() 1429{ PixelFormat.Format1bppIndexed, new int[] { -16777216, -1 } }, 1430{ PixelFormat.Format4bppIndexed, new int[] { -16777216, -8388608, -16744448, -8355840, -16777088, -8388480, -16744320, -8355712, -4144960, -65536, -16711936, -256, -16776961, -65281, -16711681, -1, } }, 1431{ 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 } } 1436public void Palette_Get_ReturnsExpected(PixelFormat pixelFormat, int[] expectedEntries) 1467using (Bitmap bitmap = new(1, 1, PixelFormat.Format32bppRgb)) 1473BitmapData data = bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb); 1502data = bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb); 1522using (Bitmap bitmap = new(1, 1, PixelFormat.Format32bppArgb)) 1526BitmapData data = bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb); 1545data = bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb); 1604public static TheoryData<PixelFormat, DitherType, PaletteType> Convert_Valid { get; } = new() 1607{ PixelFormat.Format16bppArgb1555, DitherType.None, PaletteType.FixedHalftone8 }, 1608{ PixelFormat.Format16bppRgb555, DitherType.Spiral8x8, PaletteType.FixedHalftone8 }, 1609{ PixelFormat.Format16bppRgb565, DitherType.Ordered8x8, PaletteType.FixedHalftone8 }, 1610{ PixelFormat.Format24bppRgb, DitherType.Ordered4x4, PaletteType.FixedHalftone8 }, 1611{ PixelFormat.Format32bppArgb, DitherType.DualSpiral4x4, PaletteType.FixedHalftone8 }, 1612{ PixelFormat.Format32bppPArgb, DitherType.ErrorDiffusion, PaletteType.FixedHalftone8 }, 1613{ PixelFormat.Format32bppRgb, DitherType.Solid, PaletteType.FixedHalftone8 }, 1614{ PixelFormat.Format16bppArgb1555, DitherType.None, PaletteType.FixedHalftone256 }, 1615{ PixelFormat.Format16bppRgb555, DitherType.DualSpiral8x8, PaletteType.FixedHalftone256 }, 1616{ PixelFormat.Format16bppRgb565, DitherType.None, PaletteType.FixedHalftone256 }, 1617{ PixelFormat.Format24bppRgb, DitherType.None, PaletteType.FixedHalftone256 }, 1618{ PixelFormat.Format32bppArgb, DitherType.None, PaletteType.FixedHalftone256 }, 1619{ PixelFormat.Format32bppPArgb, DitherType.None, PaletteType.FixedHalftone256 }, 1620{ PixelFormat.Format32bppRgb, DitherType.None, PaletteType.FixedHalftone256 }, 1621{ PixelFormat.Format16bppRgb565, DitherType.None, (PaletteType)(-1) }, 1624public static TheoryData<PixelFormat, DitherType, PaletteType> Convert_InvalidArgument { get; } = new() 1627{ PixelFormat.Format1bppIndexed, (DitherType)(-1), PaletteType.FixedHalftone256 }, 1628{ PixelFormat.Format1bppIndexed, DitherType.None, (PaletteType)(-1) }, 1629{ PixelFormat.Format1bppIndexed, (DitherType)(-1), (PaletteType)(-1) }, 1630{ PixelFormat.Format1bppIndexed, DitherType.None, PaletteType.FixedHalftone256 }, 1631{ PixelFormat.Format1bppIndexed, DitherType.ErrorDiffusion, PaletteType.FixedHalftone8 }, 1632{ PixelFormat.Format4bppIndexed, DitherType.Solid, PaletteType.FixedHalftone64 }, 1633{ PixelFormat.Format4bppIndexed, DitherType.None, PaletteType.FixedHalftone8 }, 1634{ PixelFormat.Format4bppIndexed, DitherType.ErrorDiffusion, PaletteType.FixedHalftone8 }, 1635{ PixelFormat.Format8bppIndexed, DitherType.None, PaletteType.FixedHalftone256 }, 1636{ PixelFormat.Format8bppIndexed, DitherType.Solid, PaletteType.FixedHalftone27 }, 1638{ PixelFormat.Format16bppGrayScale, DitherType.None, PaletteType.FixedHalftone256 }, 1639{ PixelFormat.Format16bppGrayScale, DitherType.ErrorDiffusion, PaletteType.FixedHalftone8 }, 1640{ PixelFormat.Format16bppGrayScale, DitherType.None, PaletteType.FixedBlackAndWhite }, 1641{ PixelFormat.Format16bppGrayScale, DitherType.Solid, PaletteType.FixedBlackAndWhite }, 1642{ PixelFormat.Format16bppRgb565, (DitherType)(-1), PaletteType.FixedHalftone256 }, 1643{ PixelFormat.Format16bppRgb565, (DitherType)(-1), (PaletteType)(-1) }, 1648public void Bitmap_Convert_BasicPixelFormat(PixelFormat format, DitherType dither, PaletteType palette) 1657public void Bitmap_Convert_ArgumentException(PixelFormat format, DitherType dither, PaletteType palette) 1663public static TheoryData<PixelFormat> AllValidPixelFormats { get; } = new() 1665PixelFormat.Format16bppArgb1555, 1666PixelFormat.Format16bppRgb555, 1667PixelFormat.Format16bppRgb565, 1668PixelFormat.Format24bppRgb, 1669PixelFormat.Format32bppArgb, 1670PixelFormat.Format32bppPArgb, 1671PixelFormat.Format32bppRgb, 1672PixelFormat.Format48bppRgb, 1673PixelFormat.Format64bppArgb, 1674PixelFormat.Format64bppPArgb, 1675PixelFormat.Format8bppIndexed, 1676PixelFormat.Format1bppIndexed, 1677PixelFormat.Format4bppIndexed 1682public void Bitmap_Convert_SingleArgument(PixelFormat format)
System\Drawing\GraphicsTests.cs (30)
240[InlineData(PixelFormat.Format16bppRgb555)] 241[InlineData(PixelFormat.Format16bppRgb565)] 242[InlineData(PixelFormat.Format24bppRgb)] 243[InlineData(PixelFormat.Format32bppArgb)] 244[InlineData(PixelFormat.Format32bppPArgb)] 245[InlineData(PixelFormat.Format32bppRgb)] 246[InlineData(PixelFormat.Format48bppRgb)] 247[InlineData(PixelFormat.Format64bppArgb)] 248[InlineData(PixelFormat.Format64bppPArgb)] 249public void FromImage_Bitmap_Success(PixelFormat format) 263[InlineData(PixelFormat.Format1bppIndexed)] 264[InlineData(PixelFormat.Format4bppIndexed)] 265[InlineData(PixelFormat.Format8bppIndexed)] 266public void FromImage_IndexedImage_ThrowsException(PixelFormat format) 291[InlineData(PixelFormat.Format16bppArgb1555)] 292[InlineData(PixelFormat.Format16bppGrayScale)] 293public void FromImage_Invalid16BitFormat_ThrowsExternalException(PixelFormat format) 1917yield return new object[] { PixelFormat.Format32bppArgb, Color.Red, Color.FromArgb(Color.Red.ToArgb()) }; 1918yield return new object[] { PixelFormat.Format16bppRgb555, Color.Red, Color.FromArgb(255, 248, 0, 0) }; 1923public void GetNearestColor_Color_ReturnsExpected(PixelFormat pixelFormat, Color color, Color expected) 2915[InlineData(PixelFormat.Format16bppRgb555, PixelFormat.Format32bppRgb, false)] 2916[InlineData(PixelFormat.Format32bppRgb, PixelFormat.Format16bppRgb555, true)] 2917[InlineData(PixelFormat.Format32bppArgb, PixelFormat.Format16bppRgb555, false)] 2919PixelFormat sourceFormat, 2920PixelFormat destinationFormat, 2943BitmapData data = bitmap.LockBits(default, ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb); 2957BitmapData 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)
570[InlineData(PixelFormat.Format1bppIndexed, 1)] 571[InlineData(PixelFormat.Format4bppIndexed, 4)] 572[InlineData(PixelFormat.Format8bppIndexed, 8)] 573[InlineData(PixelFormat.Format16bppArgb1555, 16)] 574[InlineData(PixelFormat.Format16bppGrayScale, 16)] 575[InlineData(PixelFormat.Format16bppRgb555, 16)] 576[InlineData(PixelFormat.Format16bppRgb565, 16)] 577[InlineData(PixelFormat.Format24bppRgb, 24)] 578[InlineData(PixelFormat.Format32bppArgb, 32)] 579[InlineData(PixelFormat.Format32bppPArgb, 32)] 580[InlineData(PixelFormat.Format32bppRgb, 32)] 581[InlineData(PixelFormat.Format48bppRgb, 48)] 582[InlineData(PixelFormat.Format64bppArgb, 64)] 583[InlineData(PixelFormat.Format64bppPArgb, 64)] 584public void GetPixelFormatSize_ReturnsExpected(PixelFormat format, int expectedSize) 590[InlineData(PixelFormat.Format16bppArgb1555, true)] 591[InlineData(PixelFormat.Format32bppArgb, true)] 592[InlineData(PixelFormat.Format32bppPArgb, true)] 593[InlineData(PixelFormat.Format64bppArgb, true)] 594[InlineData(PixelFormat.Format64bppPArgb, true)] 595[InlineData(PixelFormat.Format16bppGrayScale, false)] 596[InlineData(PixelFormat.Format16bppRgb555, false)] 597[InlineData(PixelFormat.Format16bppRgb565, false)] 598[InlineData(PixelFormat.Format1bppIndexed, false)] 599[InlineData(PixelFormat.Format24bppRgb, false)] 600[InlineData(PixelFormat.Format32bppRgb, false)] 601[InlineData(PixelFormat.Format48bppRgb, false)] 602[InlineData(PixelFormat.Format4bppIndexed, false)] 603[InlineData(PixelFormat.Format8bppIndexed, false)] 604public 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)
125using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 144using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 171using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 187using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 207using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 217using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 228using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 237using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 247using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 257using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 268using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 304using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 322using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 340using (Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb)) 356using (Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb)) 373using (Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb)) 400using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 411using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 424using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 436using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 449using (Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb)) 465using (Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb)) 481using (Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb)) 498using (Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb)) 516using (Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb)) 533using (Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb)) 549using (Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb)) 565using (Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb)) 582using (Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb)) 600using (Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb)) 638using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 660using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 678using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 695using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 711using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 727using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 738using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 749using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 761using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 774using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 800using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 815using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb); 827using Bitmap bmp = new(10, 10, PixelFormat.Format32bppArgb);
System\Drawing\TextureBrushTests.cs (11)
14yield return new object[] { new Bitmap(10, 10), PixelFormat.Format32bppPArgb, new Size(10, 10) }; 15yield return new object[] { new Metafile(Helpers.GetTestBitmapPath("telescope_01.wmf")), PixelFormat.Format32bppArgb, new Size(490, 654) }; 20public void Ctor_Bitmap(Image bitmap, PixelFormat expectedPixelFormat, Size expectedSize) 44Ctor_Bitmap(image, PixelFormat.Format32bppPArgb, new Size(11, 22)); 61public void Ctor_Image_WrapMode(Image image, WrapMode wrapMode, PixelFormat expectedPixelFormat, Size expectedSize) 96Assert.Equal(PixelFormat.Format32bppPArgb, brushImage.PixelFormat); 117Assert.Equal(PixelFormat.Format32bppPArgb, brushImage.PixelFormat); 150Assert.Equal(PixelFormat.Format32bppPArgb, brushImage.PixelFormat); 171Assert.Equal(PixelFormat.Format32bppPArgb, brushImage.PixelFormat); 205Assert.Equal(PixelFormat.Format32bppPArgb, brushImage.PixelFormat); 227Assert.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)
921using Bitmap textBmp = new(textSize.Width, textSize.Height, PixelFormat.Format32bppPArgb);
System\Windows\Forms\Rendering\ControlPaint.cs (1)
267PixelFormat.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.Design.Tests (1)
System\Windows\Forms\Design\DesignerUtilsTests.cs (1)
48((Bitmap)DesignerUtils.BoxImage).PixelFormat.Should().Be(PixelFormat.Format32bppPArgb);
System.Windows.Forms.Tests (245)
System\Windows\Forms\AxHostTests.cs (2)
1627Assert.Equal(PixelFormat.Format32bppRgb, result.PixelFormat); 1692Assert.Equal(PixelFormat.Format32bppRgb, result.PixelFormat);
System\Windows\Forms\ControlPaintTests.cs (40)
15yield return new object[] { new Bitmap(10, 10, PixelFormat.Format1bppIndexed), Color.Empty }; 16yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppRgb), Color.Empty }; 17yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppArgb), Color.Empty }; 18yield return new object[] { new Bitmap(10, 10, PixelFormat.Format1bppIndexed), Color.Red }; 19yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppRgb), Color.Red }; 20yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppArgb), Color.Red }; 21yield return new object[] { new Bitmap(10, 10, PixelFormat.Format1bppIndexed), Color.Transparent }; 22yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppRgb), Color.Transparent }; 23yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppArgb), Color.Transparent }; 24yield return new object[] { new Bitmap(11, 11, PixelFormat.Format1bppIndexed), Color.Red }; 25yield return new object[] { new Bitmap(11, 11, PixelFormat.Format32bppRgb), Color.Red }; 26yield return new object[] { new Bitmap(11, 11, PixelFormat.Format32bppArgb), Color.Red }; 27yield return new object[] { new Bitmap(16, 24, PixelFormat.Format1bppIndexed), Color.Red }; 28yield return new object[] { new Bitmap(16, 24, PixelFormat.Format32bppRgb), Color.Red }; 29yield return new object[] { new Bitmap(16, 24, PixelFormat.Format32bppArgb), Color.Red }; 43Assert.Equal(PixelFormat.Format16bppRgb555, result.PixelFormat); 68Assert.Equal(PixelFormat.Format16bppRgb555, result.PixelFormat); 91yield return new object[] { new Bitmap(10, 10, PixelFormat.Format1bppIndexed), monochromeMask }; 92yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppRgb), monochromeMask }; 93yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppArgb), monochromeMask }; 94yield return new object[] { new Bitmap(16, 24, PixelFormat.Format1bppIndexed), monochromeMask }; 95yield return new object[] { new Bitmap(16, 24, PixelFormat.Format32bppRgb), monochromeMask }; 96yield return new object[] { new Bitmap(16, 24, PixelFormat.Format32bppArgb), monochromeMask }; 97yield return new object[] { new Bitmap(11, 11, PixelFormat.Format1bppIndexed), monochromeMask }; 98yield return new object[] { new Bitmap(11, 11, PixelFormat.Format32bppRgb), monochromeMask }; 99yield return new object[] { new Bitmap(11, 11, PixelFormat.Format32bppArgb), monochromeMask }; 114Assert.Equal(PixelFormat.Format32bppRgb, result.PixelFormat); 146Assert.Equal(PixelFormat.Format32bppRgb, result.PixelFormat); 179Assert.Equal(PixelFormat.Format32bppRgb, result.PixelFormat); 200yield return new object[] { new Bitmap(10, 10, PixelFormat.Format1bppIndexed) }; 201yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppRgb) }; 202yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppArgb) }; 203yield return new object[] { new Bitmap(16, 24, PixelFormat.Format1bppIndexed) }; 204yield return new object[] { new Bitmap(16, 24, PixelFormat.Format32bppRgb) }; 205yield return new object[] { new Bitmap(16, 24, PixelFormat.Format32bppArgb) }; 206yield return new object[] { new Bitmap(11, 11, PixelFormat.Format1bppIndexed) }; 207yield return new object[] { new Bitmap(11, 11, PixelFormat.Format32bppRgb) }; 208yield return new object[] { new Bitmap(11, 11, PixelFormat.Format32bppArgb) }; 222Assert.Equal(PixelFormat.Format1bppIndexed, result.PixelFormat); 247Assert.Equal(PixelFormat.Format1bppIndexed, result.PixelFormat);
System\Windows\Forms\ControlTests.Handlers.cs (41)
3838foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb), new Bitmap(10, 10, PixelFormat.Format32bppArgb) }) 3901foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb) }) 3914yield return new object[] { parent, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 3915yield return new object[] { parent, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 3916yield return new object[] { parent, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 3917yield return new object[] { parent, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 3918yield return new object[] { parent, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 3919yield return new object[] { parent, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 3921yield return new object[] { parent, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 3922yield return new object[] { parent, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 3923yield return new object[] { parent, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 2 }; 3924yield return new object[] { parent, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 2 }; 3925yield return new object[] { parent, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 3926yield return new object[] { parent, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 3945foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb) }) 3958yield return new object[] { parent, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 3959yield return new object[] { parent, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 3960yield return new object[] { parent, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 3961yield return new object[] { parent, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 3962yield return new object[] { parent, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, expected1 }; 3963yield return new object[] { parent, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, expected1 }; 3965yield return new object[] { parent, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected1 }; 3966yield return new object[] { parent, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected1 }; 3967yield return new object[] { parent, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected1 }; 3968yield return new object[] { parent, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected1 }; 3969yield return new object[] { parent, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected1 }; 3970yield return new object[] { parent, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected1 }; 4073foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb) }) 4086yield return new object[] { true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 4087yield return new object[] { true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 4088yield return new object[] { true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 4089yield return new object[] { true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 4090yield return new object[] { false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 4091yield return new object[] { false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 4093yield return new object[] { true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4094yield return new object[] { true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4095yield return new object[] { true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4096yield return new object[] { true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4097yield return new object[] { false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4098yield return new object[] { false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 };
System\Windows\Forms\ControlTests.Properties.cs (10)
2041yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, false }; 2042yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, false }; 2043yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Center, true }; 2044yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Stretch, true }; 2045yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Zoom, true }; 2047yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppRgb), ImageLayout.None, false }; 2048yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppRgb), ImageLayout.Tile, false }; 2049yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppRgb), ImageLayout.Center, false }; 2050yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppRgb), ImageLayout.Stretch, false }; 2051yield return new object[] { new Bitmap(10, 10, PixelFormat.Format32bppRgb), ImageLayout.Zoom, false };
System\Windows\Forms\ImageList.ImageCollectionTests.cs (42)
52using Bitmap image1bppIndexed = new(1, 2, PixelFormat.Format24bppRgb); 53using Bitmap image24bppRGb = new(3, 4, PixelFormat.Format24bppRgb); 54using Bitmap image32bppRGb = new(5, 6, PixelFormat.Format32bppRgb); 55using Bitmap image32bppArgbNotTransparent = new(7, 8, PixelFormat.Format32bppArgb); 56using Bitmap image32bppArgbTransparent = new(9, 10, PixelFormat.Format32bppArgb); 68Assert.Equal(PixelFormat.Format32bppArgb, bitmap1.PixelFormat); 73Assert.Equal(PixelFormat.Format32bppArgb, bitmap2.PixelFormat); 78Assert.Equal(PixelFormat.Format32bppArgb, bitmap3.PixelFormat); 83Assert.Equal(PixelFormat.Format32bppArgb, bitmap4.PixelFormat); 88Assert.Equal(PixelFormat.Format32bppArgb, bitmap5.PixelFormat); 100using Bitmap image1bppIndexed = new(1, 2, PixelFormat.Format24bppRgb); 101using Bitmap image24bppRGb = new(3, 4, PixelFormat.Format24bppRgb); 102using Bitmap image32bppRGb = new(5, 6, PixelFormat.Format32bppRgb); 103using Bitmap image32bppArgbNotTransparent = new(7, 8, PixelFormat.Format32bppArgb); 104using Bitmap image32bppArgbTransparent = new(9, 10, PixelFormat.Format32bppArgb); 116Assert.Equal(PixelFormat.Format32bppArgb, bitmap1.PixelFormat); 121Assert.Equal(PixelFormat.Format32bppArgb, bitmap2.PixelFormat); 126Assert.Equal(PixelFormat.Format32bppArgb, bitmap3.PixelFormat); 131Assert.Equal(PixelFormat.Format32bppArgb, bitmap4.PixelFormat); 136Assert.Equal(PixelFormat.Format32bppArgb, bitmap5.PixelFormat); 144PixelFormat.Format1bppIndexed, 145PixelFormat.Format24bppRgb, 146PixelFormat.Format32bppRgb, 147PixelFormat.Format32bppArgb, 148PixelFormat.Format32bppPArgb, 153foreach (PixelFormat pixelFormat in pixelFormats) 156yield return new object[] { PixelFormat.Format24bppRgb, Color.Red, Color.FromArgb(200, 50, 75, 100) }; 163yield return new object[] { PixelFormat.Format1bppIndexed, Color.Empty, Color.Empty, Color.FromArgb(255, 0, 0, 0) }; 169yield return new object[] { PixelFormat.Format24bppRgb, Color.Red, Color.FromArgb(200, 50, 75, 100), Color.FromArgb(255, 50, 75, 100) }; 170yield return new object[] { PixelFormat.Format32bppRgb, Color.Red, Color.FromArgb(200, 50, 75, 100), Color.FromArgb(255, 50, 75, 100) }; 186public void ImageCollection_Item_Get32bppColorDepth_Success(PixelFormat pixelFormat, Color pixel00Color, Color givenPixel10Color, Color expectedPixel10Color) 212Assert.Equal(PixelFormat.Format32bppArgb, resultImage.PixelFormat); 275Assert.Equal(PixelFormat.Format32bppArgb, bitmap.PixelFormat); 296Assert.Equal(PixelFormat.Format32bppArgb, bitmap.PixelFormat); 362Assert.Equal(PixelFormat.Format32bppArgb, result1.PixelFormat); 369Assert.Equal(PixelFormat.Format32bppArgb, result1.PixelFormat); 1174Assert.Equal(PixelFormat.Format32bppArgb, result1.PixelFormat); 1180Assert.Equal(PixelFormat.Format32bppArgb, result2.PixelFormat); 1212Assert.Equal(PixelFormat.Format32bppArgb, result1.PixelFormat); 1218Assert.Equal(PixelFormat.Format32bppArgb, result2.PixelFormat); 1648Assert.Equal(PixelFormat.Format32bppArgb, bitmap.PixelFormat); 1669Assert.Equal(PixelFormat.Format32bppArgb, bitmap.PixelFormat);
System\Windows\Forms\ScrollableControlTests.cs (41)
1512foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb), new Bitmap(10, 10, PixelFormat.Format32bppArgb) }) 1584foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb) }) 1598yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 1599yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 1600yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 1601yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 1602yield return new object[] { parentFactory(), hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 1603yield return new object[] { parentFactory(), hScroll, vScroll, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 1605yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 1606yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 1607yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 2 }; 1608yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 2 }; 1609yield return new object[] { parentFactory(), hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 1610yield return new object[] { parentFactory(), hScroll, vScroll, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 1628foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb) }) 1648yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 1649yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 1650yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, expected1 }; 1651yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, expected1 }; 1652yield return new object[] { parentFactory(), hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 1653yield return new object[] { parentFactory(), hScroll, vScroll, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 1655yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected1 }; 1656yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected1 }; 1657yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected1 }; 1658yield return new object[] { parentFactory(), hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected1 }; 1659yield return new object[] { parentFactory(), hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected1 }; 1660yield return new object[] { parentFactory(), hScroll, vScroll, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected1 }; 1784foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb) }) 1798yield return new object[] { hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 1799yield return new object[] { hScroll, vScroll, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 1800yield return new object[] { hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 1801yield return new object[] { hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 1802yield return new object[] { hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 1803yield return new object[] { hScroll, vScroll, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 1805yield return new object[] { hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 1806yield return new object[] { hScroll, vScroll, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 1807yield return new object[] { hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 1808yield return new object[] { hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 1809yield return new object[] { hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 1810yield return new object[] { hScroll, vScroll, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 };
System\Windows\Forms\TabPageTests.cs (28)
3960foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb), new Bitmap(10, 10, PixelFormat.Format32bppArgb) }) 4014foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb) }) 4027yield return new object[] { appearance, useVisualStyleBackColor, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 4028yield return new object[] { appearance, useVisualStyleBackColor, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 4029yield return new object[] { appearance, useVisualStyleBackColor, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 4030yield return new object[] { appearance, useVisualStyleBackColor, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 4031yield return new object[] { appearance, useVisualStyleBackColor, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 4032yield return new object[] { appearance, useVisualStyleBackColor, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 4034yield return new object[] { appearance, useVisualStyleBackColor, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4035yield return new object[] { appearance, useVisualStyleBackColor, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4036yield return new object[] { appearance, useVisualStyleBackColor, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4037yield return new object[] { appearance, useVisualStyleBackColor, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4038yield return new object[] { appearance, useVisualStyleBackColor, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4039yield return new object[] { appearance, useVisualStyleBackColor, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4153foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb) }) 4166yield return new object[] { appearance, useVisualStyleBackColor, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 4167yield return new object[] { appearance, useVisualStyleBackColor, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 4168yield return new object[] { appearance, useVisualStyleBackColor, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 4169yield return new object[] { appearance, useVisualStyleBackColor, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 4170yield return new object[] { appearance, useVisualStyleBackColor, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 4171yield return new object[] { appearance, useVisualStyleBackColor, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 4173yield return new object[] { appearance, useVisualStyleBackColor, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4174yield return new object[] { appearance, useVisualStyleBackColor, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4175yield return new object[] { appearance, useVisualStyleBackColor, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4176yield return new object[] { appearance, useVisualStyleBackColor, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4177yield return new object[] { appearance, useVisualStyleBackColor, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 4178yield return new object[] { appearance, useVisualStyleBackColor, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 };
System\Windows\Forms\ToolStripTests.cs (41)
5853foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb), new Bitmap(10, 10, PixelFormat.Format32bppArgb) }) 5926foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb) }) 5940yield return new object[] { parent, hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 5941yield return new object[] { parent, hScroll, vScroll, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 5942yield return new object[] { parent, hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 5943yield return new object[] { parent, hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 5944yield return new object[] { parent, hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 5945yield return new object[] { parent, hScroll, vScroll, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 5947yield return new object[] { parent, hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 5948yield return new object[] { parent, hScroll, vScroll, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 5949yield return new object[] { parent, hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 2 }; 5950yield return new object[] { parent, hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 2 }; 5951yield return new object[] { parent, hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 5952yield return new object[] { parent, hScroll, vScroll, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 5978foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb) }) 5998yield return new object[] { parent, hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, expected1 }; 5999yield return new object[] { parent, hScroll, vScroll, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, expected1 }; 6000yield return new object[] { parent, hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, expected1 }; 6001yield return new object[] { parent, hScroll, vScroll, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, expected1 }; 6002yield return new object[] { parent, hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, expected2 }; 6003yield return new object[] { parent, hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, expected2 }; 6005yield return new object[] { parent, hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected2 }; 6006yield return new object[] { parent, hScroll, vScroll, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected2 }; 6007yield return new object[] { parent, hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected2 }; 6008yield return new object[] { parent, hScroll, vScroll, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected2 }; 6009yield return new object[] { parent, hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected2 }; 6010yield return new object[] { parent, hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, expected2 }; 6124foreach (Image backgroundImage in new Image[] { null, new Bitmap(10, 10, PixelFormat.Format32bppRgb) }) 6137yield return new object[] { hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 6138yield return new object[] { hScroll, vScroll, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 6139yield return new object[] { hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 6140yield return new object[] { hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 1 }; 6141yield return new object[] { hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 6142yield return new object[] { hScroll, vScroll, false, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.None, 0 }; 6144yield return new object[] { hScroll, vScroll, true, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 6145yield return new object[] { hScroll, vScroll, true, Color.Red, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 6146yield return new object[] { hScroll, vScroll, true, Color.FromArgb(100, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 6147yield return new object[] { hScroll, vScroll, true, Color.FromArgb(0, 50, 100, 150), new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 6148yield return new object[] { hScroll, vScroll, false, Color.Empty, new Bitmap(10, 10, PixelFormat.Format32bppArgb), ImageLayout.Tile, 1 }; 6149yield 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);