Modifica colore Pixel immagini
Updated at: 16/09/2013


Questa funzione permette di creare un'immagine e salvarla definendo per ogni pixel la terna rgb
public static void drow_image()
        {
            int width = 200;
            int height = 100;
            Bitmap new_pict = new Bitmap(width, height);
            Color newcol;

            for (int x = 0; x < width; x++)
            {
                for (int y = 0; y < height; y++)
                {
                    if ((x + y) % 2 == 0)
                    {
                        newcol = Color.FromArgb(0, 128, 128);
                    }
                    else
                    {
                        newcol = Color.FromArgb(255, 0, 0);
                    }

                    new_pict.SetPixel(x, y, newcol);
                }
            }

            new_pict.Save(@"C:\drown_pict.jpg");
        }