Selenium is wired to the settings page and has been modified to allow screenshot to be taken at any time
This commit is contained in:
@@ -19,6 +19,8 @@ namespace Test_Merge
|
||||
private int _grandPrixYear = 2000;
|
||||
private List<string> _driverList = new List<string>();
|
||||
|
||||
private F1TVEmulator Emulator = null;
|
||||
|
||||
private bool CreatingZone = false;
|
||||
private Point ZoneP1;
|
||||
private Point ZoneP2;
|
||||
@@ -256,5 +258,29 @@ namespace Test_Merge
|
||||
}
|
||||
return new Rectangle(newP1.X, newP1.Y,newP2.X-newP1.X,newP2.Y -newP2.Y);
|
||||
}
|
||||
|
||||
private async void btnRefresh_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Emulator == null)
|
||||
{
|
||||
Emulator = new F1TVEmulator(tbxGpUrl.Text);
|
||||
}
|
||||
|
||||
if (!Emulator.Ready)
|
||||
{
|
||||
if (await Emulator.Start() != 0)
|
||||
{
|
||||
MessageBox.Show("Could not start the emulator");
|
||||
}
|
||||
else
|
||||
{
|
||||
pbxMain.Image = Emulator.Screenshot();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pbxMain.Image = Emulator.Screenshot();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user