Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using System.IO;
- using UnityEngine;
- using UnityEngine.UI;
- public class CaptureScreenshot : MonoBehaviour {
- // Use this for initialization
- void Start () {
- }
- // Update is called once per frame
- void Update () {
- }
- public void snapPhoto()
- {
- StartCoroutine(TakeScreenshot());
- }
- public IEnumerator TakeScreenshot()
- {
- string imageName = "pothole.png";
- // Take the screenshot
- ScreenCapture.CaptureScreenshot(imageName);
- //Wait for 4 frames
- for (int i = 0; i < 5; i++)
- {
- yield return null;
- }
- // Read the data from the file
- //byte[] data = File.ReadAllBytes(Application.persistentDataPath + "/" + imageName);
- //byte[] data = File.ReadAllBytes("C:/Users/boellis//Desktop//TheFuture//ARBusinessCard//SmartCityHack//pothole.png");
- //Debug.Log(data);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement