var str = "hello world";
var sb = new StringBuilder();
foreach (var c in str)
{
sb.Append(Convert.ToString(c, 2));
}
str = sb.ToString();
var image = new Bitmap(str.Length, 1);
for (var index = 0; index < str.Length; index++)
{
var c = str[index];
switch (c)
{
case '1':
image.SetPixel(index,0, Color.Black);
break;
case '0':
image.SetPixel(index,0, Color.White);
break;
}
}
pictureBox1.Image = image;