"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

Black Background in screenshot

I'm actually using the below script and its working fine. This script is actually used to share the screenshot. But my problem is after capturing the screenshot,the background appears to be black. How to avoid this black background? Pls Help! using System.Collections; using System.Collections.Generic; using UnityEngine; using System.IO; public class NativeShareScript : MonoBehaviour { public GameObject CanvasShareObj; private bool isProcessing = false; private bool isFocus = false; public void ShareBtnPress() { if (!isProcessing) { CanvasShareObj.SetActive(true); StartCoroutine(ShareScreenshot()); } } IEnumerator ShareScreenshot() { isProcessing = true; yield return new WaitForEndOfFrame(); Application.CaptureScreenshot("screenshot.png", 2); string destination = Path.Combine(Application.persistentDataPath, "screenshot.png"); yield return new WaitForSecondsRealtime(0.3f); if (!Application.isEditor) { AndroidJavaClass intentClass = new AndroidJavaClass("android.content.Intent"); AndroidJavaObject intentObject = new AndroidJavaObject("android.content.Intent"); intentObject.Call("setAction", intentClass.GetStatic("ACTION_SEND")); AndroidJavaClass uriClass = new AndroidJavaClass("android.net.Uri"); AndroidJavaObject uriObject = uriClass.CallStatic("parse", "file://" + destination); intentObject.Call("putExtra", intentClass.GetStatic("EXTRA_STREAM"), uriObject); intentObject.Call("putExtra", intentClass.GetStatic("EXTRA_TEXT"), "Type your comments"); intentObject.Call("setType", "image/jpeg"); AndroidJavaClass unity = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); AndroidJavaObject currentActivity = unity.GetStatic("currentActivity"); AndroidJavaObject chooser = intentClass.CallStatic("createChooser", intentObject, "Share your new score"); currentActivity.Call("startActivity", chooser); yield return new WaitForSecondsRealtime(1); } yield return new WaitUntil(() => isFocus); CanvasShareObj.SetActive(false); isProcessing = false; } private void OnApplicationFocus(bool focus) { isFocus = focus; } }

Hello degeta,

This article goes over a couple different ways to get the camera image in Vuforia https://library.vuforia.com/content/vuforia-library/en/articles/Solution/Working-with-the-Camera.html#How-To-Access-the-Camera-Image-in-Unity

Thanks,

Attachment