Bitmap practice

Run Settings
LanguageC#
Language Version
Run Command
using System; using System.Collections.Generic; using System.Drawing; class MainClass { static void Main() { List<List<int>> x = new List<List<int>>(); int[,] b = {{0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,1,0,0,0,0}, {0,0,0,0,1,1,1,0,0,0}, {0,0,0,0,0,1,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0}}; for(int i = 0; i < b.GetLength(0); i ++) { x.Add(new List<int>()); } int y = 1; foreach(int i in b) { x[(y-1)].Add(i); if(y++ % b.GetLength(0) == 0) { y = 1; } } Bitmap gol = new Bitmap(x.Count,x[0].Count); foreach(List<int> i in x) { foreach(int a in i) { if(List[i][a] == 0) gol.SetPixel(i,a,Color.White); if(List[i][a] == 1) gol.SetPixel(i,a,Color.Black); } } gol.GetHBitmap; } }
Editor Settings
Theme
Key bindings
Full width
Lines