Class ScreenshotUtility
Utility class to aide in taking screenshots via menu items and public APIs. Screenshots can be capture at various resolutions and with the current camera's clear color or a transparent clear color for use in easy post compositing of images.
Inherited Members
Namespace: Microsoft.MixedReality.Toolkit.Utilities.Editor
Assembly: cs.temp.dll.dll
Syntax
public class ScreenshotUtility
Methods
CaptureScreenshot(String, Int32, Boolean, Camera)
Captures a screenshot with the current main camera's clear color.
Declaration
public static bool CaptureScreenshot(string path, int superSize = 1, bool transparentClearColor = false, Camera camera = null)
Parameters
Type | Name | Description |
---|---|---|
String | path | The path to save the screenshot to. |
Int32 | superSize | The multiplication factor to apply to the native resolution. |
Boolean | transparentClearColor | True if the captured screenshot should have a transparent clear color. Which can be used for screenshot overlays. |
Camera | camera | The optional camera to take the screenshot from. |
Returns
Type | Description |
---|---|
Boolean | True on successful screenshot capture, false otherwise. |
CaptureScreenshot(String, Int32, Boolean, Camera)
Captures a screenshot with the current main camera's clear color.
Declaration
public static bool CaptureScreenshot(string path, int superSize = 1, bool transparentClearColor = false, Camera camera = null)
Parameters
Type | Name | Description |
---|---|---|
String | path | The path to save the screenshot to. |
Int32 | superSize | The multiplication factor to apply to the native resolution. |
Boolean | transparentClearColor | True if the captured screenshot should have a transparent clear color. Which can be used for screenshot overlays. |
Camera | camera | The optional camera to take the screenshot from. |
Returns
Type | Description |
---|---|
Boolean | True on successful screenshot capture, false otherwise. |
GetScreenshotDirectory()
Gets a directory which is safe for saving screenshots.
Declaration
public static string GetScreenshotDirectory()
Returns
Type | Description |
---|---|
String | A directory safe for saving screenshots. |
GetScreenshotDirectory()
Gets a directory which is safe for saving screenshots.
Declaration
public static string GetScreenshotDirectory()
Returns
Type | Description |
---|---|
String | A directory safe for saving screenshots. |
GetScreenshotPath()
Gets a unique screenshot path with a file name based on date and time.
Declaration
public static string GetScreenshotPath()
Returns
Type | Description |
---|---|
String | A unique screenshot path. |
GetScreenshotPath()
Gets a unique screenshot path with a file name based on date and time.
Declaration
public static string GetScreenshotPath()
Returns
Type | Description |
---|---|
String | A unique screenshot path. |