Guest User

Untitled

a guest
Mar 10th, 2014
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.46 KB | None | 0 0
  1. private Bitmap bufor = null;
  2. private void Form1_Paint(object sender, PaintEventArgs e){
  3.     Graphics g = e.Graphics;
  4.     bufor = new Bitmap(this.ClientSize.Width, this.ClientSize.Height);
  5.  
  6.     for(int x=0;x< this.ClientSize.Width;x++){
  7.         for(int y=0;y<this.ClientSize.Height;y++){
  8.             int G = (int)(255 * 0.5*(1+Math.Sin((y-x)/10.0)));
  9.             int R = (int)(255 * 0.5*(1+Math.Sin((x+y)/10.0)));
  10.             bufor.SetPixel(x,y,Color.FromArgb(R,G,0));
  11.         }
  12.     }
  13.     g.DrawImage(bufor,0,0);
  14.  
  15. }
Advertisement
Add Comment
Please, Sign In to add comment