Last active
August 29, 2015 14:04
-
-
Save theBonesae/d0aba7bc6bc4075f4be0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Drawing; | |
namespace ConsoleApplication9 { | |
class Program { | |
static void Main(string[] args) { | |
while (true) { | |
List<Color> colors = new List<Color>(); | |
int size = 30; | |
KnownColor[] colorss = Enum.GetValues(typeof(KnownColor)) as KnownColor[]; | |
Console.WriteLine("Please input a name:"); | |
string name = Console.ReadLine(); | |
for (int i = 0; i < name.Length; i++) { | |
colors.Add(Color.FromKnownColor(colorss[i + 27 + name[i]])); | |
} | |
int counter1 = 1; | |
Bitmap bitMap = new Bitmap(size, size); | |
for (int i = 0; i < size; i++) { | |
for (int j = 0; j < size; j++) { | |
bitMap.SetPixel(j,i, colors[((i * i + j * j) + name[counter1]) % name.Length]); | |
counter1++; | |
if (counter1 >= colors.Count) { | |
counter1 = 1; | |
} | |
} | |
} | |
Graphics g = Graphics.FromImage(bitMap); | |
g.Dispose(); | |
bitMap.Save(name + ".png"); | |
bitMap.Dispose(); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment