111 references to ImageLockMode
PresentationFramework-SystemDrawing (1)
SystemDrawingExtension.cs (1)
173
ImageLockMode
.WriteOnly,
System.Drawing (1)
System.Drawing.cs (1)
91
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.Imaging.
ImageLockMode
))]
System.Drawing.Common (2)
Special\NotSupported.cs (2)
38
public 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); }
39
public 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); }
System.Drawing.Common.Tests (99)
DrawingTest.cs (1)
14
BitmapData data = bitmap.LockBits(new Rectangle(default, bitmap.Size),
ImageLockMode
.ReadWrite, bitmap.PixelFormat);
mono\System.Drawing.Imaging\BmpCodecTests.cs (1)
242
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height),
ImageLockMode
.ReadOnly, PixelFormat.Format24bppRgb);
mono\System.Drawing.Imaging\GifCodecTests.cs (1)
109
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height),
ImageLockMode
.ReadOnly, PixelFormat.Format24bppRgb);
mono\System.Drawing.Imaging\IconCodecTests.cs (5)
132
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height),
ImageLockMode
.ReadOnly, PixelFormat.Format24bppRgb);
328
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height),
ImageLockMode
.ReadOnly, PixelFormat.Format24bppRgb);
546
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height),
ImageLockMode
.ReadOnly, PixelFormat.Format24bppRgb);
750
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height),
ImageLockMode
.ReadOnly, PixelFormat.Format24bppRgb);
1525
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height),
ImageLockMode
.ReadOnly, PixelFormat.Format24bppRgb);
mono\System.Drawing.Imaging\JpegCodecTests.cs (2)
112
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height),
ImageLockMode
.ReadOnly, PixelFormat.Format24bppRgb);
227
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height),
ImageLockMode
.ReadOnly, PixelFormat.Format24bppRgb);
mono\System.Drawing.Imaging\PngCodecTests.cs (3)
145
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height),
ImageLockMode
.ReadOnly, PixelFormat.Format24bppRgb);
297
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height),
ImageLockMode
.ReadOnly, PixelFormat.Format24bppRgb);
470
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height),
ImageLockMode
.ReadOnly, PixelFormat.Format24bppRgb);
mono\System.Drawing.Imaging\TiffCodecTests.cs (1)
119
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height),
ImageLockMode
.ReadOnly, PixelFormat.Format24bppRgb);
mono\System.Drawing\BitmapTests.cs (20)
64
BitmapData bd = bmp.LockBits(rect,
ImageLockMode
.ReadWrite, PixelFormat.Format24bppRgb);
74
bd = bmp.LockBits(rect,
ImageLockMode
.ReadWrite, PixelFormat.Format8bppIndexed, bd);
111
BitmapData data = bmp.LockBits(r,
ImageLockMode
.ReadOnly, PixelFormat.Format24bppRgb);
114
Assert.Throws<InvalidOperationException>(() => bmp.LockBits(r,
ImageLockMode
.ReadOnly, PixelFormat.Format24bppRgb));
216
BitmapData bd = bmp.LockBits(new Rectangle(0, 0, 2, 1),
ImageLockMode
.ReadOnly, format);
411
data = test.LockBits(new Rectangle(0, 0, test.Width, test.Height),
ImageLockMode
.ReadOnly, test.PixelFormat);
500
private static byte[] HashLock(Bitmap bmp, int width, int height, PixelFormat fmt,
ImageLockMode
mode)
562
byte[] actual = HashLock(bmp, bmp.Width, bmp.Height, PixelFormat.Format32bppArgb,
ImageLockMode
.ReadWrite);
575
byte[] actual = HashLock(bmp, bmp.Width, bmp.Height, PixelFormat.Format32bppPArgb,
ImageLockMode
.ReadWrite);
588
byte[] actual = HashLock(bmp, bmp.Width, bmp.Height, PixelFormat.Format32bppRgb,
ImageLockMode
.ReadWrite);
601
byte[] actual = HashLock(bmp, bmp.Width, bmp.Height, PixelFormat.Format24bppRgb,
ImageLockMode
.ReadWrite);
617
byte[] actual = HashLock(bmp, 50, 50, PixelFormat.Format32bppArgb,
ImageLockMode
.ReadWrite);
630
byte[] actual = HashLock(bmp, 50, 50, PixelFormat.Format32bppPArgb,
ImageLockMode
.ReadWrite);
643
byte[] actual = HashLock(bmp, 50, 50, PixelFormat.Format32bppRgb,
ImageLockMode
.ReadWrite);
656
byte[] actual = HashLock(bmp, 50, 50, PixelFormat.Format24bppRgb,
ImageLockMode
.ReadWrite);
680
data = bmp.LockBits(new Rectangle(0, 0, 1, 1),
ImageLockMode
.ReadOnly, PixelFormat.Format32bppArgb);
709
data = bmp.LockBits(new Rectangle(0, 0, 1, 1),
ImageLockMode
.ReadWrite, PixelFormat.Format32bppArgb);
733
data = bmp.LockBits(new Rectangle(0, 0, 1, 1),
ImageLockMode
.ReadOnly, PixelFormat.Format24bppRgb);
753
data = bmp.LockBits(new Rectangle(0, 0, 1, 1),
ImageLockMode
.ReadWrite, PixelFormat.Format24bppRgb);
798
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height),
ImageLockMode
.ReadWrite, PixelFormat.Format1bppIndexed);
System\Drawing\BitmapTests.cs (63)
1014
yield return new object[] { bitmap(), new Rectangle(0, 0, 2, 2),
ImageLockMode
.ReadOnly, PixelFormat.Format32bppArgb, 8, 1 };
1015
yield return new object[] { bitmap(), new Rectangle(0, 0, 2, 2),
ImageLockMode
.ReadWrite, PixelFormat.Format32bppArgb, 8, 3 };
1016
yield return new object[] { bitmap(), new Rectangle(0, 0, 2, 2),
ImageLockMode
.WriteOnly, PixelFormat.Format32bppArgb, 8, 2 };
1018
yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), new Rectangle(0, 0, 100, 100),
ImageLockMode
.ReadOnly, PixelFormat.Format32bppRgb, 400, 1 };
1019
yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), new Rectangle(0, 0, 100, 100),
ImageLockMode
.ReadWrite, PixelFormat.Format32bppRgb, 400, 3 };
1020
yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), new Rectangle(0, 0, 100, 100),
ImageLockMode
.WriteOnly, PixelFormat.Format32bppRgb, 400, 2 };
1022
yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), new Rectangle(0, 0, 100, 100),
ImageLockMode
.ReadOnly, PixelFormat.Format24bppRgb, 300, 65537 };
1023
yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), new Rectangle(0, 0, 100, 100),
ImageLockMode
.ReadWrite, PixelFormat.Format24bppRgb, 300, 65539 };
1024
yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), new Rectangle(0, 0, 100, 100),
ImageLockMode
.WriteOnly, PixelFormat.Format24bppRgb, 300, 65538 };
1026
yield return new object[] { new Bitmap(100, 100, PixelFormat.Format24bppRgb), new Rectangle(0, 0, 100, 100),
ImageLockMode
.ReadOnly, PixelFormat.Format24bppRgb, 300, 1 };
1027
yield return new object[] { new Bitmap(100, 100, PixelFormat.Format24bppRgb), new Rectangle(0, 0, 100, 100),
ImageLockMode
.ReadWrite, PixelFormat.Format24bppRgb, 300, 3 };
1028
yield return new object[] { new Bitmap(100, 100, PixelFormat.Format24bppRgb), new Rectangle(0, 0, 100, 100),
ImageLockMode
.WriteOnly, PixelFormat.Format24bppRgb, 300, 2 };
1030
yield return new object[] { new Bitmap(100, 100, PixelFormat.Format24bppRgb), new Rectangle(0, 0, 100, 100),
ImageLockMode
.ReadOnly, PixelFormat.Format32bppRgb, 400, 65537 };
1031
yield return new object[] { new Bitmap(100, 100, PixelFormat.Format24bppRgb), new Rectangle(0, 0, 100, 100),
ImageLockMode
.ReadWrite, PixelFormat.Format32bppRgb, 400, 65539 };
1032
yield return new object[] { new Bitmap(100, 100, PixelFormat.Format24bppRgb), new Rectangle(0, 0, 100, 100),
ImageLockMode
.WriteOnly, PixelFormat.Format32bppRgb, 400, 65538 };
1034
yield return new object[] { new Bitmap(100, 100, PixelFormat.Format8bppIndexed), new Rectangle(0, 0, 100, 100),
ImageLockMode
.ReadOnly, PixelFormat.Format24bppRgb, 300, 65537 };
1036
yield return new object[] { new Bitmap(100, 100, PixelFormat.Format8bppIndexed), new Rectangle(0, 0, 100, 100),
ImageLockMode
.ReadOnly, PixelFormat.Format8bppIndexed, 100, 1 };
1037
yield return new object[] { new Bitmap(100, 100, PixelFormat.Format8bppIndexed), new Rectangle(0, 0, 100, 100),
ImageLockMode
.ReadWrite, PixelFormat.Format8bppIndexed, 100, 3 };
1038
yield return new object[] { new Bitmap(100, 100, PixelFormat.Format8bppIndexed), new Rectangle(0, 0, 100, 100),
ImageLockMode
.WriteOnly, PixelFormat.Format8bppIndexed, 100, 2 };
1040
yield return new object[] { new Bitmap(184, 184, PixelFormat.Format1bppIndexed), new Rectangle(0, 0, 184, 184),
ImageLockMode
.ReadOnly, PixelFormat.Format1bppIndexed, 24, 1 };
1041
yield return new object[] { new Bitmap(184, 184, PixelFormat.Format1bppIndexed), new Rectangle(0, 0, 184, 184),
ImageLockMode
.ReadWrite, PixelFormat.Format1bppIndexed, 24, 3 };
1042
yield return new object[] { new Bitmap(184, 184, PixelFormat.Format1bppIndexed), new Rectangle(0, 0, 184, 184),
ImageLockMode
.WriteOnly, PixelFormat.Format1bppIndexed, 24, 2 };
1044
yield return new object[] { bitmap(), new Rectangle(1, 1, 1, 1),
ImageLockMode
.ReadOnly, PixelFormat.Format32bppArgb, 8, 1 };
1045
yield return new object[] { bitmap(), new Rectangle(1, 1, 1, 1),
ImageLockMode
.ReadWrite, PixelFormat.Format32bppArgb, 8, 3 };
1046
yield return new object[] { bitmap(), new Rectangle(1, 1, 1, 1),
ImageLockMode
.WriteOnly, PixelFormat.Format32bppArgb, 8, 2 };
1048
yield return new object[] { bitmap(), new Rectangle(1, 1, 1, 1),
ImageLockMode
.ReadOnly - 1, PixelFormat.Format32bppArgb, 8, 0 };
1050
yield return new object[] { bitmap(), new Rectangle(0, 0, 2, 2),
ImageLockMode
.WriteOnly, PixelFormat.Format16bppGrayScale, 4, 65538 };
1052
yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), new Rectangle(0, 0, 100, 100),
ImageLockMode
.ReadOnly, PixelFormat.Format8bppIndexed, 100, 65537 };
1053
yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), new Rectangle(0, 0, 100, 100),
ImageLockMode
.ReadWrite, PixelFormat.Format8bppIndexed, 100, 65539 };
1054
yield return new object[] { new Bitmap(100, 100, PixelFormat.Format32bppRgb), new Rectangle(0, 0, 100, 100),
ImageLockMode
.WriteOnly, PixelFormat.Format8bppIndexed, 100, 65538 };
1056
yield return new object[] { new Bitmap(100, 100, PixelFormat.Format8bppIndexed), new Rectangle(0, 0, 100, 100),
ImageLockMode
.ReadWrite, PixelFormat.Format24bppRgb, 300, 65539 };
1057
yield return new object[] { new Bitmap(100, 100, PixelFormat.Format8bppIndexed), new Rectangle(0, 0, 100, 100),
ImageLockMode
.WriteOnly, PixelFormat.Format24bppRgb, 300, 65538 };
1062
public void LockBits_Invoke_Success(Bitmap bitmap, Rectangle rectangle,
ImageLockMode
lockMode, PixelFormat pixelFormat, int expectedStride, int expectedReserved)
1095
AssertExtensions.Throws<ArgumentNullException>("bitmapData", () => bitmap.LockBits(Rectangle.Empty,
ImageLockMode
.ReadOnly, PixelFormat.Format24bppRgb, null));
1113
AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(x, y, width, height),
ImageLockMode
.ReadOnly, bitmap.PixelFormat));
1116
AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(x, y, width, height),
ImageLockMode
.ReadOnly, bitmap.PixelFormat, bitmapData));
1132
foreach (
ImageLockMode
lockMode in Enum.GetValues(typeof(
ImageLockMode
)))
1146
AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1),
ImageLockMode
.ReadOnly, PixelFormat.Format16bppGrayScale));
1147
AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1),
ImageLockMode
.ReadOnly, PixelFormat.Format16bppGrayScale, new BitmapData()));
1149
AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1),
ImageLockMode
.ReadWrite, PixelFormat.Format16bppGrayScale));
1150
AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1),
ImageLockMode
.ReadWrite, PixelFormat.Format16bppGrayScale, new BitmapData()));
1152
BitmapData data = bitmap.LockBits(new Rectangle(0, 0, 1, 1),
ImageLockMode
.WriteOnly, PixelFormat.Format16bppGrayScale);
1157
[InlineData((
ImageLockMode
)(-1))]
1158
[InlineData(
ImageLockMode
.UserInputBuffer + 1)]
1159
[InlineData(
ImageLockMode
.UserInputBuffer)]
1160
public void LockBits_InvalidLockMode_ThrowsArgumentException(
ImageLockMode
lockMode)
1175
AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1),
ImageLockMode
.ReadOnly, PixelFormat.Format32bppArgb));
1178
AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1),
ImageLockMode
.ReadOnly, PixelFormat.Format32bppArgb, bitmapData));
1186
bitmap.LockBits(new Rectangle(0, 0, 1, 1),
ImageLockMode
.ReadOnly, bitmap.PixelFormat);
1188
Assert.Throws<InvalidOperationException>(() => bitmap.LockBits(new Rectangle(0, 0, 1, 1),
ImageLockMode
.ReadOnly, bitmap.PixelFormat));
1189
Assert.Throws<InvalidOperationException>(() => bitmap.LockBits(new Rectangle(0, 0, 1, 1),
ImageLockMode
.ReadOnly, bitmap.PixelFormat, new BitmapData()));
1191
Assert.Throws<InvalidOperationException>(() => bitmap.LockBits(new Rectangle(1, 1, 1, 1),
ImageLockMode
.ReadOnly, bitmap.PixelFormat));
1192
Assert.Throws<InvalidOperationException>(() => bitmap.LockBits(new Rectangle(1, 1, 1, 1),
ImageLockMode
.ReadOnly, bitmap.PixelFormat, new BitmapData()));
1202
BitmapData data = bitmap.LockBits(new Rectangle(offset, offset, 1, 1),
ImageLockMode
.ReadOnly, bitmap.PixelFormat);
1213
BitmapData data = bitmap.LockBits(new Rectangle(0, 0, 1, 1),
ImageLockMode
.ReadOnly, bitmap.PixelFormat);
1225
BitmapData data = bitmap.LockBits(new Rectangle(0, 0, 1, 1),
ImageLockMode
.ReadOnly, bitmap.PixelFormat);
1249
BitmapData data = bitmap.LockBits(new Rectangle(0, 0, 1, 1),
ImageLockMode
.ReadOnly, bitmap.PixelFormat);
1348
BitmapData bitmapData = bitmap.LockBits(new Rectangle(0, 0, 2, 1),
ImageLockMode
.ReadOnly, format);
1474
BitmapData data = bitmap.LockBits(new Rectangle(0, 0, 1, 1),
ImageLockMode
.ReadOnly, PixelFormat.Format32bppArgb);
1503
data = bitmap.LockBits(new Rectangle(0, 0, 1, 1),
ImageLockMode
.ReadWrite, PixelFormat.Format32bppArgb);
1527
BitmapData data = bitmap.LockBits(new Rectangle(0, 0, 1, 1),
ImageLockMode
.ReadOnly, PixelFormat.Format24bppRgb);
1546
data = bitmap.LockBits(new Rectangle(0, 0, 1, 1),
ImageLockMode
.ReadWrite, PixelFormat.Format24bppRgb);
System\Drawing\GraphicsTests.cs (2)
2903
BitmapData data = bitmap.LockBits(default,
ImageLockMode
.ReadOnly, PixelFormat.Format32bppArgb);
2917
BitmapData data = bitmap.LockBits(default,
ImageLockMode
.ReadOnly, PixelFormat.Format32bppArgb);
System.Windows.Forms (3)
System\Windows\Forms\Controls\ImageList\ImageList.cs (2)
625
bmpData = tmpBitmap.LockBits(imageInfo.rcImage,
ImageLockMode
.ReadOnly, tmpBitmap.PixelFormat);
632
targetData = result.LockBits(new Rectangle(0, 0, _imageSize.Width, _imageSize.Height),
ImageLockMode
.WriteOnly, PixelFormat.Format32bppArgb);
System\Windows\Forms\Rendering\ControlPaint.cs (1)
269
ImageLockMode
.ReadOnly,
System.Windows.Forms.Design (1)
System\Windows\Forms\Design\DesignerUtils.cs (1)
671
BitmapData data = b.LockBits(new Rectangle(0, 0, b.Width, b.Height),
ImageLockMode
.ReadWrite, PixelFormat.Format32bppArgb);
System.Windows.Forms.Tests (2)
System\Windows\Forms\DataObject_BitmapBinderTests.cs (2)
69
BitmapData originalData = bitmap.LockBits(default,
ImageLockMode
.ReadOnly, PixelFormat.Format32bppArgb);
70
BitmapData deserializedData = deserializedBitmap.LockBits(default,
ImageLockMode
.ReadOnly, PixelFormat.Format32bppArgb);
System.Windows.Forms.UI.IntegrationTests (2)
Infra\ScreenRecordService.cs (2)
248
lockedBitmaps[0] = (frames[0].image, frames[0].image.LockBits(bounds,
ImageLockMode
.ReadOnly, PixelFormat.Format32bppArgb));
267
lockedBitmaps[currentFrameBufferIndex] = (frames[i].image, frames[i].image.LockBits(bounds,
ImageLockMode
.ReadOnly, PixelFormat.Format32bppArgb));