public static void Init(Form1 form) {
timer.Interval = 10;
timer.Start();
timer.Tick += Timer_Tick;
Graphics g;
context = BufferedGraphicsManager.Current;
Width = 600;
Height = 600;
g = form.CreateGraphics();
buffer = context.Allocate(g, new Rectangle(0, 0, form.Width-100, form.Height-100));
}