diff --git a/UI/Controls/ctrlRecentGame.cs b/UI/Controls/ctrlRecentGame.cs index e222e2c..af9d713 100644 --- a/UI/Controls/ctrlRecentGame.cs +++ b/UI/Controls/ctrlRecentGame.cs @@ -44,19 +44,19 @@ namespace Mesen.GUI.Controls lblGameName.Text = Path.GetFileNameWithoutExtension(_recentGame.RomName); lblSaveDate.Text = _recentGame.Timestamp.ToString(); - try { - ZipArchive zip = new ZipArchive(new MemoryStream(File.ReadAllBytes(_recentGame.FileName))); - ZipArchiveEntry entry = zip.GetEntry("Screenshot.png"); - if(entry != null) { - using(Stream stream = entry.Open()) { - picPreviousState.Image = Image.FromStream(stream); + Task.Run(() => { + Image img = null; + try { + ZipArchive zip = new ZipArchive(new MemoryStream(File.ReadAllBytes(_recentGame.FileName))); + ZipArchiveEntry entry = zip.GetEntry("Screenshot.png"); + if(entry != null) { + using(Stream stream = entry.Open()) { + img = Image.FromStream(stream); + } } - } else { - picPreviousState.Image = null; - } - } catch { - picPreviousState.Image = null; - } + } catch { } + picPreviousState.Image = img; + }); lblGameName.Visible = true; lblSaveDate.Visible = true;