# Unity Screenshot Feature

## Introduction <a href="#h_introduction" id="h_introduction"></a>

Capturing screenshots in a Unity web application involves capturing the current state of the application's viewport and saving it as an image file. This can be useful for various purposes, such as sharing gameplay moments, creating documentation, or debugging. Below is a description of how to achieve screenshot capture in a Unity web application using blippar sdk:

## Enable UI button trough blippar settings <a href="#h_enableuibutton" id="h_enableuibutton"></a>

"Enable Photo UI" parameter allows you to show/hide the screenshot button state, to show the button just check the Enable Photo UI button and uncheck for hide.

<figure><img src="/files/5uPuoNY3dVJfQZJlL91i" alt=""><figcaption><p>Enable screenshot button</p></figcaption></figure>

Once you check the "Enable Photo UI" and build a project the bbutton will we visible in your experience

<figure><img src="https://github.com/blippar/gitbook/blob/main/v1.6.3/.gitbook/assets/Screenshot_button.png" alt=""><figcaption><p>screenshot button</p></figcaption></figure>

## Screenshot Preview <a href="#h_screenshotpreview" id="h_screenshotpreview"></a>

A screenshot preview in a web application involves capturing a visual representation of the current state of the application's viewport and displaying it as a preview within the application's user interface. This feature allows users to quickly see a snapshot of the scene they are interacting. The UI provides two options in preview window, delete and download

* Delete Screenshot
* Download Screebshot

<figure><img src="/files/JfkSUB0tlAZU62PgKHTl" alt=""><figcaption><p>screenshot preview</p></figcaption></figure>

## Take screenshot programmatically <a href="#h_screenshotpreview" id="h_screenshotpreview"></a>

Taking screenshots programmatically in a Unity application allows you to capture the current state of the game or application.

* Uncheck the "Enable Photo UI" from inspector window.
* Write a script to cature screenshot and call a method "WEBARSDK.TakeScreenshot(returnBuffer)"
* "returnBuffer" is a boolean value if returnBuffer->false a preview UI with download button is displayed on the screen.
* and if "returnBuffer" is true the "WEBARSDK.TakeScreenshot" method converts the screenshot image data in binary format and to access this data user needs to call a method "WEBARSDK.GetScreenshotTexture" after some delay.
* "WEBARSDK.GetScreenshotTexture" will return a image data in base64 string format, using this string user can convert or use it anywhere according to the use case.

<figure><img src="/files/t12oqGdrTZG2mZCyFEXn" alt=""><figcaption><p>screenshot script</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.blippar.com/webar-sdk/v.1.7.0/integrations/unity-integration/unity-screenshot-feature.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
