Skip to content

Commit bddf35f

Browse files
committed
Adding no-format override to .NET Screenshot class for saving file
This commit adds a method to supply only a file name for the screenshot image file, which will save the image in a Portable Network Graphics (PNG) format.
1 parent 2c9b5ba commit bddf35f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

dotnet/src/webdriver/Screenshot.cs

+11
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,17 @@ public byte[] AsByteArray
9292
get { return this.byteArray; }
9393
}
9494

95+
/// <summary>
96+
/// Saves the screenshot to a Portable Network Graphics (PNG) file, overwriting the
97+
/// file if it already exists.
98+
/// </summary>
99+
/// <param name="fileName">The full path and file name to save the screenshot to.</param>
100+
/// to save the image to.</param>
101+
public void SaveAsFile(string fileName)
102+
{
103+
this.SaveAsFile(fileName, ScreenshotImageFormat.Png);
104+
}
105+
95106
/// <summary>
96107
/// Saves the screenshot to a file, overwriting the file if it already exists.
97108
/// </summary>

0 commit comments

Comments
 (0)