122 references to PixelFormat
System.Drawing.Common.Tests (84)
DrawingTest.cs (1)
14BitmapData data = bitmap.LockBits(new Rectangle(default, bitmap.Size), ImageLockMode.ReadWrite, bitmap.PixelFormat);
mono\System.Drawing.Imaging\BmpCodecTests.cs (5)
48Assert.Equal(PixelFormat.Format4bppIndexed, bmp.PixelFormat); 114Assert.Equal(PixelFormat.Format8bppIndexed, bmp.PixelFormat); 180Assert.Equal(PixelFormat.Format24bppRgb, bmp.PixelFormat); 384Assert.Equal(PixelFormat.Format32bppRgb, bmp.PixelFormat); 444Assert.Equal(expected, bmpLoad.PixelFormat);
mono\System.Drawing.Imaging\GifCodecTests.cs (2)
45Assert.Equal(PixelFormat.Format8bppIndexed, bmp.PixelFormat); 198Assert.Equal(expected, bmpLoad.PixelFormat);
mono\System.Drawing.Imaging\IconCodecTests.cs (9)
45Assert.Equal(PixelFormat.Format32bppArgb, image.PixelFormat); 50Assert.Equal(PixelFormat.Format32bppArgb, bmp.PixelFormat); 74Assert.Equal(PixelFormat.Format32bppArgb, bmp.PixelFormat); 222Assert.Equal(PixelFormat.Format32bppArgb, bmp.PixelFormat); 427Assert.Equal(PixelFormat.Format32bppArgb, bmp.PixelFormat); 649Assert.Equal(PixelFormat.Format32bppArgb, bmp.PixelFormat); 907Assert.Equal(PixelFormat.Format32bppArgb, bmp.PixelFormat); 1841Assert.Equal(PixelFormat.Format32bppArgb, bmp.PixelFormat); 1885Assert.Equal(expected, bmpLoad.PixelFormat);
mono\System.Drawing.Imaging\JpegCodecTests.cs (3)
47Assert.Equal(PixelFormat.Format8bppIndexed, bmp.PixelFormat); 174Assert.Equal(PixelFormat.Format24bppRgb, bmp.PixelFormat); 363Assert.Equal(expected, bmpLoad.PixelFormat);
mono\System.Drawing.Imaging\PngCodecTests.cs (4)
47Assert.Equal(PixelFormat.Format1bppIndexed, bmp.PixelFormat); 250Assert.Equal(PixelFormat.Format32bppArgb, bmp.PixelFormat); 357Assert.Equal(PixelFormat.Format4bppIndexed, bmp.PixelFormat); 584Assert.Equal(expected, bmpLoad.PixelFormat);
mono\System.Drawing.Imaging\TiffCodecTests.cs (2)
67Assert.Equal(PixelFormat.Format24bppRgb, bmp.PixelFormat); 255Assert.Equal(expected, bmpLoad.PixelFormat);
mono\System.Drawing\BitmapTests.cs (8)
339Assert.Equal(bmp.PixelFormat, bmpNew.PixelFormat); 395int pixels_per_byte = src.PixelFormat switch 400_ => throw new InvalidOperationException($"Cannot pass a bitmap of format {src.PixelFormat} to RotateIndexedBmp"), 411data = test.LockBits(new Rectangle(0, 0, test.Width, test.Height), ImageLockMode.ReadOnly, test.PixelFormat); 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)
347Assert.Equal(PixelFormat.Format4bppIndexed, img.PixelFormat);
System\Drawing\BitmapTests.cs (39)
48Assert.Equal(pixelFormat, bitmap.PixelFormat); 61Assert.Equal(pixelFormat, bitmap.PixelFormat); 90Assert.Equal(PixelFormat.Format8bppIndexed, bitmap.PixelFormat); 124Assert.Equal(pixelFormat, bitmap.PixelFormat); 138Assert.Equal(pixelFormat, bitmap.PixelFormat); 167Assert.Equal(PixelFormat.Format32bppArgb, bitmap.PixelFormat); 191Assert.Equal(pixelFormat, bitmap.PixelFormat); 210Assert.Equal(pixelFormat, bitmap.PixelFormat); 290Assert.Equal(PixelFormat.Format32bppPArgb, bitmap.PixelFormat); 307Assert.Equal(PixelFormat.Format32bppArgb, bitmap.PixelFormat); 324Assert.Equal(PixelFormat.Format32bppArgb, bitmap.PixelFormat); 335Assert.Equal(PixelFormat.Format32bppArgb, bitmap.PixelFormat); 376Assert.Equal(targetFormat, clone.PixelFormat); 412Assert.Equal(format, clone.PixelFormat); 426AssertExtensions.Throws<ArgumentException>(null, () => bitmap.Clone(new Rectangle(0, 0, width, height), bitmap.PixelFormat)); 427AssertExtensions.Throws<ArgumentException>(null, () => bitmap.Clone(new RectangleF(0, 0, width, height), bitmap.PixelFormat)); 440Assert.Throws<OutOfMemoryException>(() => bitmap.Clone(new Rectangle(x, y, width, height), bitmap.PixelFormat)); 441Assert.Throws<OutOfMemoryException>(() => bitmap.Clone(new RectangleF(x, y, width, height), bitmap.PixelFormat)); 606Assert.Equal(PixelFormat.Format32bppRgb, result.PixelFormat); 619Assert.Equal(PixelFormat.Format32bppRgb, result.PixelFormat); 628Assert.Equal(PixelFormat.Format32bppRgb, result.PixelFormat); 703Assert.Equal(PixelFormat.Format32bppArgb, result.PixelFormat); 754Assert.Equal(expectedPngBitmap.PixelFormat, outputPngBitmap.PixelFormat); 1113AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(x, y, width, height), ImageLockMode.ReadOnly, bitmap.PixelFormat)); 1116AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(x, y, width, height), ImageLockMode.ReadOnly, bitmap.PixelFormat, bitmapData)); 1163AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), lockMode, bitmap.PixelFormat)); 1166AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), lockMode, bitmap.PixelFormat, bitmapData)); 1186bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly, bitmap.PixelFormat); 1188Assert.Throws<InvalidOperationException>(() => bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly, bitmap.PixelFormat)); 1189Assert.Throws<InvalidOperationException>(() => bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly, bitmap.PixelFormat, new BitmapData())); 1191Assert.Throws<InvalidOperationException>(() => bitmap.LockBits(new Rectangle(1, 1, 1, 1), ImageLockMode.ReadOnly, bitmap.PixelFormat)); 1192Assert.Throws<InvalidOperationException>(() => bitmap.LockBits(new Rectangle(1, 1, 1, 1), ImageLockMode.ReadOnly, bitmap.PixelFormat, new BitmapData())); 1202BitmapData data = bitmap.LockBits(new Rectangle(offset, offset, 1, 1), ImageLockMode.ReadOnly, bitmap.PixelFormat); 1213BitmapData data = bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly, bitmap.PixelFormat); 1225BitmapData data = bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly, bitmap.PixelFormat); 1249BitmapData data = bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly, bitmap.PixelFormat); 1653bitmap.PixelFormat.Should().Be(format); 1687bitmap.PixelFormat.Should().Be(format);
System\Drawing\IconTests.cs (2)
525Assert.Equal(PixelFormat.Format32bppArgb, bitmap.PixelFormat); 563Assert.Equal(PixelFormat.Format32bppArgb, bitmap.PixelFormat);
System\Drawing\TextureBrushTests.cs (8)
27Assert.Equal(expectedPixelFormat, brushImage.PixelFormat); 68Assert.Equal(expectedPixelFormat, brushImage.PixelFormat); 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 (5)
System\Windows\Forms\Control.cs (1)
4878using Bitmap image = new(width, height, bitmap.PixelFormat);
System\Windows\Forms\Controls\ImageList\ImageList.cs (1)
625bmpData = tmpBitmap.LockBits(imageInfo.rcImage, ImageLockMode.ReadOnly, tmpBitmap.PixelFormat);
System\Windows\Forms\Controls\ToolStrips\ToolStripHighContrastRenderer.cs (2)
112if (Image.GetPixelFormatSize(image.PixelFormat) > 16) 392if (Image.GetPixelFormatSize(image.PixelFormat) > 16)
System\Windows\Forms\Rendering\ControlPaint.cs (1)
2431Bitmap result = new(bitmap.Width, bitmap.Height, bitmap.PixelFormat);
System.Windows.Forms.Design (1)
System\Windows\Forms\Design\ImageListImage.cs (1)
42public PixelFormat PixelFormat => Image.PixelFormat;
System.Windows.Forms.Primitives (1)
System\Windows\Forms\Internals\ScaleHelper.cs (1)
177Bitmap scaledBitmap = new(desiredSize.Width, desiredSize.Height, bitmap.PixelFormat);
System.Windows.Forms.Tests (30)
System\Windows\Forms\AxHostTests.cs (2)
1625Assert.Equal(PixelFormat.Format32bppRgb, result.PixelFormat); 1690Assert.Equal(PixelFormat.Format32bppRgb, result.PixelFormat);
System\Windows\Forms\ControlPaintTests.cs (7)
41Assert.Equal(PixelFormat.Format16bppRgb555, result.PixelFormat); 66Assert.Equal(PixelFormat.Format16bppRgb555, result.PixelFormat); 112Assert.Equal(PixelFormat.Format32bppRgb, result.PixelFormat); 144Assert.Equal(PixelFormat.Format32bppRgb, result.PixelFormat); 177Assert.Equal(PixelFormat.Format32bppRgb, result.PixelFormat); 220Assert.Equal(PixelFormat.Format1bppIndexed, result.PixelFormat); 245Assert.Equal(PixelFormat.Format1bppIndexed, result.PixelFormat);
System\Windows\Forms\ImageList.ImageCollectionTests.cs (21)
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); 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); 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.UI.IntegrationTests (1)
Infra\ScreenRecordService.cs (1)
325Bitmap croppedSource = frames[i].image.Clone(cropArea, frames[i].image.PixelFormat);