private void timer1_Tick(object sender, EventArgs e) { LuckyCore.NextRand(); luckyPictureBox.Image = new Bitmap(LuckyCore.CurrentPicThumb); luckyPictureBox.Show(); this.Text = Title + LuckyCore.CurrentPicUrl; }
private void PrepareForStart() { this.Text = Title + "Preloading thumbnails"; btnChooseFolder.Enabled = false; Thread th = new Thread(() => { LuckyCore.LoadAndStart(_pictures, _config.ThumbnailWidth, _config.ThumbnailHeight); this.Invoke(new MethodInvoker(() => { btnChooseFolder.Enabled = true; btnStart.Enabled = true; UpdateStatistics(); })); }); th.Start(); }
private void KeyEntered() { if (_status == Status.Flashing) { // stop and celebrate _status = Status.Celebrating; timer1.Stop(); // show full picture luckyPictureBox.Load(LuckyCore.CurrentPicUrl); LuckyCore.Celebrate(); } else { // start drawing _status = Status.Flashing; timer1.Start(); } }
private void btnReset_Click(object sender, EventArgs e) { LuckyCore.Reset(); UpdateStatistics(); }