private void CmdGo_Click(object sender, EventArgs e) { InitializeRandomNumberGenerator(); int originx = 10; // PicSparkler.Width / 2; int originy = PicSparkler.Height / 2; Graphics g = PicSparkler.CreateGraphics(); g.DrawLine(Pens.White, new Point(originx, originy), new Point(originx + 5000, originy + 1000)); // TBD Create and draw ONE sparkler _Sparkler = CreateSparkler(originx, originy); for (int i = 0; i < _Sparkler._SparkList.Count; i++) { _Sparkler.DrawSpark(_G, i); } _Sparkler.AddLine(new Point(originx, originy), new Point(originx + 5000, originy + 1000)); CmdGo.Enabled = false; // Initialize, then start the timer. //InitializeTimer(); _Timer.Start(); }
Graphics _G; // TBD May not be necessary; may be able to use CreateGraphics() as needed, below. public FrmMain() { InitializeComponent(); InitializeTimer(); _G = PicSparkler.CreateGraphics(); }