public void TestGetRGBDataAt() { BitmapData bitmapData = new BitmapData(); bitmapData.Data = new byte[] { 33, 255, 29, 8, 40, 82, 39, 88, 12, 0, 0, 0, 28, 128, 37, 200, 182, 22, 47, 19, 192, 0, 0, 0, 89, 45, 221, 120, 23, 64, 11, 33, 191, 0, 0, 0 }; bitmapData.ColorMode = BitmapColorMode.TrueColor; bitmapData.Width = 3; bitmapData.Height = 3; Assert.Equal(new RGB(29, 255, 33), bitmapData.GetRGBDataAt(0, 0)); Assert.Equal(new RGB(12, 88, 39), bitmapData.GetRGBDataAt(2, 0)); Assert.Equal(new RGB(191, 33, 11), bitmapData.GetRGBDataAt(2, 2)); Assert.Throws <ArgumentOutOfRangeException>(() => bitmapData.GetRGBDataAt(3, 1)); Assert.Throws <NotThisColorModeException>(() => bitmapData.Get8BitDataAt(1, 0)); }