A set of .NET Framework managed libraries for developing graphical user interfaces.
Hello @mc ,
Thanks for your question.
Since your array is laid out row by row, you just iterate through the array and map each index to an (x, y) pixel position.
You can refer to following example:
From Color[]:
Color[] colors = new Color[48 * 12];
var bmp = new Bitmap(48, 12);
for (int i = 0; i < colors.Length; i++)
bmp.SetPixel(i % 48, i / 48, colors[i]);
pictureBox1.Image = bmp;
From int[] (ARGB packed):
int[] colors = new int[48 * 12];
var bmp = new Bitmap(48, 12);
for (int i = 0; i < colors.Length; i++)
bmp.SetPixel(i % 48, i / 48, Color.FromArgb(colors[i]));
pictureBox1.Image = bmp;
I hope this addresses your question. If this response was helpful, please consider following the guidance to provide feedback.