Hello
Im using Vuforia + Prime31 Social Network, and i want to capture screenshots and share it via email or facebook, but when i capture screenshot the QCAR stops and i get the blackscreenshot with my GUI. How can i capture screenshot with vuforia ?
here is my code that im using from Prime31:
using UnityEngine;
using System.Collections;
using Prime31;
#if UNITY_IPHONE
public class SharingGUIManager : MonoBehaviourGUI
{
public static string screenshotFilename = "someScreenshot.png";
void Start()
{
// listen to the events fired by the SharingManager for illustration purposes
SharingManager.sharingFinishedWithActivityTypeEvent += ( activityType ) =>
{
Debug.Log( "sharingFinishedWithActivityTypeEvent: " + activityType );
} ;
SharingManager.sharingCancelledEvent += () =>
{
Debug.Log( "sharingCancelledEvent" );
} ;
// grab a screenshot for later use
Application.CaptureScreenshot( screenshotFilename );
}
void OnGUI()
{
beginColumn();
if( GUILayout.Button( "Share URL and Text" ) )
{
SharingBinding.shareItems( new string[] { "http://prime31.com", "Here is some text with the URL" } );
}
if( GUILayout.Button( "Share Screenshot" ) )
{
Application.CaptureScreenshot( screenshotFilename );
var pathToImage = System.IO.Path.Combine( Application.persistentDataPath, screenshotFilename );
if( !System.IO.File.Exists( pathToImage ) )
{
Debug.LogError( "there is no screenshot avaialable at path: " + pathToImage );
return;
}
SharingBinding.shareItems( new string[] { pathToImage } );
}
if( GUILayout.Button( "Share Screenshot and Text" ) )
{
Application.CaptureScreenshot( screenshotFilename );
var pathToImage = System.IO.Path.Combine( Application.persistentDataPath, screenshotFilename );
if( !System.IO.File.Exists( pathToImage ) )
{
Debug.LogError( "there is no screenshot avaialable at path: " + pathToImage );
return;
}
SharingBinding.shareItems( new string[] { pathToImage, "Here is some text with the image" } );
}
endColumn();
if( bottomRightButton( "Facebook..." ) )
{
Application.LoadLevel( "FacebookTestScene" );
}
}
}
#endif
Thank You
Gets Black Screen in My Screenshots with Prime31 Social Network
Vuforia needs to have exclusive access to the camera while the QCARBehaviour is enabled. Here is an article on enabling screen shots - https://developer.vuforia.com/resources/dev-guide/unity-screenshots
Gets Black Screen in My Screenshots with Prime31 Social Network
Thank you David for your reply, Actualy im new to unity, and im doing my school stuff.
i want to explain what ive done that you can please explain how to make it work:
Gets Black Screen in My Screenshots with Prime31 Social Network
hi boomidi, do you solve the problem. i face the samething like you, i really dont understand about the solution for theblack screen.