Log in or register to post comments

Capture Screenshoot Help

November 24, 2013 - 1:50pm #1

I have this script attach to the AR camera,  But when I press the Capture Screen Button, I does not capture the screen.

Any help please.

heres the code..

 

using UnityEngine;
using System.Collections;

public class TakePictire : MonoBehaviour {

	
	void OnGUI()
{
    if (GUI.Button(new Rect(20, 20, 150, 100), "CaptureScreenshot"))
    {
        Application.CaptureScreenshot("Screenshot.png");
    }
}
}

 

Capture Screenshoot Help

November 24, 2013 - 5:37pm #5

I use this code, when press the buttton, looks like it take the photo, by a fast screen freeze, but does not save the .png anywhere.

How can I fix that?

 

using UnityEngine;
using System.Collections;

public class TakePictire : MonoBehaviour {

private Texture2D m_Texture;
void Start()
{
    m_Texture = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, true);
}
void OnGUI()
{
    if (GUI.Button(new Rect(20, 20, 150, 100), "ReadPixels"))
    {
        m_Texture.ReadPixels(new Rect(0, 0, Screen.width, Screen.height), 0, 0, true);
        m_Texture.Apply();
    }
}
}

 

Capture Screenshoot Help

November 24, 2013 - 5:04pm #4

Capture Screenshoot Help

November 24, 2013 - 4:54pm #3

is for Iphone..

Capture Screenshoot Help

November 24, 2013 - 4:49pm #2

Be sure to enable write access and check your SD card. See: https://developer.vuforia.com/resources/dev-guide/unity-screenshots

Log in or register to post comments