using System ;
using System . Collections . Generic;
using System . ComponentModel;
using System . Data;
using System . Drawing;
using System . Text;
using System . Windows . Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private List < byte > = new List < byte > ();
private int = 0 ;
private Random = new Random ();
private const int = 12 ;
private Pen = new Pen ( Color . FromArgb( 0x00 , 0x80 , 0x40 ));
private Pen = new Pen ( Color . FromArgb( 0x00 , 0xFF , 0x00 ));
private void timer1_Tick( object sender, EventArgs e)
{
while ( . Count > 1000 ) . RemoveAt( 0 );
. Add(( byte ) . Next( 256 ));
= ( + 1 ) %
Invalidate();
}
private void Form1_Paint( object sender, PaintEventArgs e)
{
e . Graphics . FillRectangle( Brushes . Black, e . Graphics . ClipBounds);
#region
for ( int i = ClientSize . Width - i >= 0 ; i -=
e . Graphics . DrawLine(i, 0 , i, ClientSize . Height);
for ( int i = ClientSize . Height; i >= 0 ; i -=
e . Graphics . DrawLine( 0 , i, ClientSize . Width, i);
#endregion
#region
if ( . Count <= 1 ) return; //
byte A = . Count - 1 ];
for ( int i = . Count - 2 ; i >= 0 ; i -- )
{
byte B =
e . Graphics . DrawLine(
new Point (ClientSize . Width - . Count + i - 1 ,
( int )((( double )A / 255 ) * ClientSize . Height)),
new Point (ClientSize . Width - . Count + i,
( int )((( double )B / 255 ) * ClientSize . Height)));
A = B;
}
#endregion
}
private void Form1_Resize( object sender, EventArgs e)
{
Invalidate();
}
private void Form1_Load( object sender, EventArgs e)
{
DoubleBuffered = true ;
timer1 . Enabled = true ;
timer1 . Interval = 100 ;
}
}
}