Class SteamScreenshots
Purpose: Functions for adding screenshots to the user's screenshot library
Inherited Members
Namespace: Unity.Steamworks.Interop
Assembly: Unity.Steamworks.Interop.dll
Syntax
public static class SteamScreenshots
Methods
AddScreenshotToLibrary(string, string, int, int)
Adds a screenshot to the user's screenshot library from disk. If a thumbnail is provided, it must be 200 pixels wide and the same aspect ratio as the screenshot, otherwise a thumbnail will be generated if the user uploads the screenshot. The screenshots must be in either JPEG or TGA format. The return value is a handle that is valid for the duration of the game process and can be used to apply tags. JPEG, TGA, and PNG formats are supported.
Declaration
public static ScreenshotHandle AddScreenshotToLibrary(string pchFilename, string pchThumbnailFilename, int nWidth, int nHeight)
Parameters
| Type | Name | Description |
|---|---|---|
| string | pchFilename | Passed through to |
| string | pchThumbnailFilename | Passed through to |
| int | nWidth | Passed through to |
| int | nHeight | Passed through to |
Returns
| Type | Description |
|---|---|
| ScreenshotHandle | The value |
AddVRScreenshotToLibrary(EVRScreenshotType, string, string)
Adds a VR screenshot to the user's screenshot library from disk in the supported type. pchFilename should be the normal 2D image used in the library view pchVRFilename should contain the image that matches the correct type The return value is a handle that is valid for the duration of the game process and can be used to apply tags. JPEG, TGA, and PNG formats are supported.
Declaration
public static ScreenshotHandle AddVRScreenshotToLibrary(EVRScreenshotType eType, string pchFilename, string pchVRFilename)
Parameters
| Type | Name | Description |
|---|---|---|
| EVRScreenshotType | eType | Passed through to |
| string | pchFilename | Passed through to |
| string | pchVRFilename | Passed through to |
Returns
| Type | Description |
|---|---|
| ScreenshotHandle | The value |
HookScreenshots(bool)
Toggles whether the overlay handles screenshots when the user presses the screenshot hotkey, or the game handles them. If the game is hooking screenshots, then the ScreenshotRequested_t callback will be sent if the user presses the hotkey, and the game is expected to call WriteScreenshot or AddScreenshotToLibrary in response.
Declaration
public static void HookScreenshots(bool bHook)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | bHook | Passed through to |
IsScreenshotsHooked()
Returns true if the app has hooked the screenshot
Declaration
public static bool IsScreenshotsHooked()
Returns
| Type | Description |
|---|---|
| bool | The value |
SetLocation(ScreenshotHandle, string)
Sets metadata about a screenshot's location (for example, the name of the map)
Declaration
public static bool SetLocation(ScreenshotHandle hScreenshot, string pchLocation)
Parameters
| Type | Name | Description |
|---|---|---|
| ScreenshotHandle | hScreenshot | Passed through to |
| string | pchLocation | Passed through to |
Returns
| Type | Description |
|---|---|
| bool | The value |
TagPublishedFile(ScreenshotHandle, PublishedFileId_t)
Tags a published file as being visible in the screenshot
Declaration
public static bool TagPublishedFile(ScreenshotHandle hScreenshot, PublishedFileId_t unPublishedFileID)
Parameters
| Type | Name | Description |
|---|---|---|
| ScreenshotHandle | hScreenshot | Passed through to |
| PublishedFileId_t | unPublishedFileID | Passed through to |
Returns
| Type | Description |
|---|---|
| bool | The value |
TagUser(ScreenshotHandle, CSteamID)
Tags a user as being visible in the screenshot
Declaration
public static bool TagUser(ScreenshotHandle hScreenshot, CSteamID steamID)
Parameters
| Type | Name | Description |
|---|---|---|
| ScreenshotHandle | hScreenshot | Passed through to |
| CSteamID | steamID | Passed through to |
Returns
| Type | Description |
|---|---|
| bool | The value |
TriggerScreenshot()
Causes the Steam overlay to take a screenshot. If screenshots are being hooked by the game then a ScreenshotRequested_t callback is sent back to the game instead.
Declaration
public static void TriggerScreenshot()
WriteScreenshot(byte[], uint, int, int)
Writes a screenshot to the user's screenshot library given the raw image data, which must be in RGB format. The return value is a handle that is valid for the duration of the game process and can be used to apply tags.
Declaration
public static ScreenshotHandle WriteScreenshot(byte[] pubRGB, uint cubRGB, int nWidth, int nHeight)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | pubRGB | Passed through to |
| uint | cubRGB | Passed through to |
| int | nWidth | Passed through to |
| int | nHeight | Passed through to |
Returns
| Type | Description |
|---|---|
| ScreenshotHandle | The value |