vendredi 7 mars 2014

[Discuss] Image generation algorithms topic




I find it pretty fun to generate "random" images using different algorithms, so maybe someone else likes it too. Post your pics and algorithms in this thread if you have any.

Here is mine :D


And source


Code:


using (Graphics g = Graphics.FromImage(bmp))
                  {
                      for (int x = 0; x != bmp.Width;x++ )
                      {
                          for(int y= 0; y != bmp.Height;y++)
                          {
                              datetime = (int)DateTime.Now.Ticks;
                              p = new Pen(Color.FromArgb(((int)Math.Sqrt((x) ^ 2 + (y) ^ 2)*(int)Math.Sqrt(x + y))*datetime | 0x1337));
                              bmp.SetPixel(x, y, p.Color);
                          }
                      }
                      bmp.Save(@"C:\run1.jpeg");
                      pictureBox1.Image = bmp;
}







Aucun commentaire:

Enregistrer un commentaire