0
Reply

Back Color

soulfusion

soulfusion

May 16 2005 12:12 PM
1.7k
Hi guys. I was just wandering...this proggi makes a sin graph across a form. I wanna know how to make half the background above the graph 1 color and below the graph another color. Heres da code so far. [STAThread] static void Main() { Application.Run(new Form1()); } private System.Windows.Forms.Timer timer1; private int myX = 0; private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { Graphics myGrap = e.Graphics; Point[] mySin = new Point[Width]; for (int x = 0 ; x < Width;x++) { mySin[x].Y = (System.Convert.ToInt16(System.Math.Sin(myX/5) * 10)) + (Width/3); mySin[x].X = x; myX++; } myGrap.DrawCurve(System.Drawing.Pens.Black,mySin,0); } //below is the timer code private void timer1_Tick(object sender, System.EventArgs e) { this.Invalidate(); } } Thanks alot Cheerz