/// <summary> /// Save the image locally or on the server. /// </summary> /// <param name="textureToSave">The texture to save.</param> public void SaveImage(Texture textureToSave) { if (textureToSave == null) { return; } TestGameLogger.Info(@"Saving non null image"); var testName = CurrentTestContext != null ? CurrentTestContext.Test.FullName : null; TestGameLogger.Info(@"saving remotely."); using (var image = textureToSave.GetDataAsImage()) { try { SendImage(image, testName); } catch (Exception) { TestGameLogger.Error(@"An error occurred when trying to send the data to the server."); throw; } } }
/// <summary> /// Save the image locally or on the server. /// </summary> public void SaveBackBuffer() { TestGameLogger.Info(@"Saving the backbuffer"); SaveImage(GraphicsDevice.BackBuffer); }