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.
@@ -92,6 +92,17 @@ public byte[] AsByteArray
get { return this.byteArray; }
}
+ /// <summary>
+ /// Saves the screenshot to a Portable Network Graphics (PNG) file, overwriting the
+ /// file if it already exists.
+ /// </summary>
+ /// <param name="fileName">The full path and file name to save the screenshot to.</param>
+ /// to save the image to.</param>
+ public void SaveAsFile(string fileName)
+ {
+ this.SaveAsFile(fileName, ScreenshotImageFormat.Png);
+ }
+
/// <summary>
/// Saves the screenshot to a file, overwriting the file if it already exists.
/// </summary>
