mrtk_developmentreleases/2.0.0releases/2.1.0releases/2.2.0

    Show / Hide Table of Contents

    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.

    Inheritance
    Object
    ScreenshotUtility
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    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.

    In This Article
    • Methods
      • CaptureScreenshot(String, Int32, Boolean, Camera)
      • CaptureScreenshot(String, Int32, Boolean, Camera)
      • GetScreenshotDirectory()
      • GetScreenshotDirectory()
      • GetScreenshotPath()
      • GetScreenshotPath()
    Back to top Generated by DocFX