2D-массив не объявляет правильный размерC#

Место общения программистов C#
Anonymous
2D-массив не объявляет правильный размер

Сообщение Anonymous »

Здесь я создаю новый 2D-массив. _console.Buffer.Width — 960, а _console.Buffer.Height — 360. Но создаваемый массив всегда равен 256, 144.

Код: Выделить всё

glyphBuffer = new Glyph[_console.Buffer.Width, _console.Buffer.Height];

Код: Выделить всё

internal readonly struct Glyph
{
public readonly char Value;
public readonly int ForegroundIndex;
public readonly int BackgroundIndex;

public Glyph(char value, int foregroundIndex, int backgroundIndex)
{
Value = value;
ForegroundIndex = foregroundIndex;
BackgroundIndex = backgroundIndex;
}
}
Кто-нибудь знает, почему это происходит?
Я проверил точки останова и на 100 % уверен, что это так.
п>

Подробнее здесь: https://stackoverflow.com/questions/783 ... right-size

Вернуться в «C#»