void OnGUI()
    {
        GUILayout.Label(log);
        if (GUI.Button(new Rect(20, 20, 150, 50), "Save Full Screen"))
        {
            snapShot.CaptureAndSaveToAlbum();
        }

        GUI.Label(new Rect(20, 70, 500, 20), "------------------------------------------------------------------------------------------------------------------------------");

        GUI.Label(new Rect(20, 100, 50, 20), "X : ");
        x = GUI.TextField(new Rect(80, 100, 50, 20), x);

        GUI.Label(new Rect(160, 100, 50, 20), "Y : ");
        y = GUI.TextField(new Rect(200, 100, 50, 20), y);

        GUI.Label(new Rect(20, 130, 50, 20), "Width : ");
        width = GUI.TextField(new Rect(80, 130, 50, 20), width);

        GUI.Label(new Rect(150, 130, 50, 20), "Height : ");
        height = GUI.TextField(new Rect(200, 130, 50, 20), height);

        if (GUI.Button(new Rect(20, 160, 150, 50), "Save Selected Screen") && int.Parse(width) > 0 && int.Parse(height) > 0)
        {
            snapShot.CaptureAndSaveToAlbum(int.Parse(x), int.Parse(y), int.Parse(width), int.Parse(height));
        }


        GUI.Label(new Rect(20, 230, 500, 20), "------------------------------------------------------------------------------------------------------------------------------");
        GUI.Label(new Rect(70, 250, 200, 50), "Click This Texture to Save");
        if (GUI.Button(new Rect(50, 270, 200, 200), tex) && tex != null)
        {
            snapShot.SaveTextureToGallery(tex);
        }
    }
Exemplo n.º 2
0
    void OnGUI()
    {
        GUILayout.Label(log);
        if (GUI.Button(new Rect(20, 20, 150, 50), "Save Full Screen"))
        {
            snapShot.CaptureAndSaveToAlbum(ImageType.JPG);
            //snapShot.CaptureAndSaveAtPath(System.IO.Path.Combine(Application.persistentDataPath,"Image.jpg"),ImageType.JPG);
        }

        if (GUI.Button(new Rect(200, 20, 170, 50), "Save in double resolution"))
        {
            snapShot.CaptureAndSaveToAlbum(Screen.width * 2, Screen.height * 2, Camera.main, ImageType.JPG);
        }

        if (GUI.Button(new Rect(380, 20, 170, 50), "Save with watermark"))
        {
            snapShot.CaptureAndSaveToAlbum(Screen.width, Screen.height, Camera.main, ImageType.JPG, watermark, WatermarkAlignment.TOP_LEFT);
        }

        GUI.Label(new Rect(20, 70, 500, 20), "------------------------------------------------------------------------------------------------------------------------------");

        GUI.Label(new Rect(20, 100, 50, 20), "X : ");
        x = GUI.TextField(new Rect(80, 100, 50, 20), x);

        GUI.Label(new Rect(160, 100, 50, 20), "Y : ");
        y = GUI.TextField(new Rect(200, 100, 50, 20), y);

        GUI.Label(new Rect(20, 130, 50, 20), "Width : ");
        width = GUI.TextField(new Rect(80, 130, 50, 20), width);

        GUI.Label(new Rect(150, 130, 50, 20), "Height : ");
        height = GUI.TextField(new Rect(200, 130, 50, 20), height);

        if (GUI.Button(new Rect(20, 160, 150, 50), "Save Selected Screen") && int.Parse(width) > 0 && int.Parse(height) > 0)
        {
            snapShot.CaptureAndSaveToAlbum(int.Parse(x), int.Parse(y), int.Parse(width), int.Parse(height), ImageType.JPG);
        }
        if (GUI.Button(new Rect(200, 160, 250, 50), "Save Selected Screen with watermark") && int.Parse(width) > 0 && int.Parse(height) > 0)
        {
            snapShot.CaptureAndSaveToAlbum(int.Parse(x), int.Parse(y), int.Parse(width), int.Parse(height), ImageType.JPG, watermark, WatermarkAlignment.CENTER);
        }


        GUI.Label(new Rect(20, 230, 500, 20), "------------------------------------------------------------------------------------------------------------------------------");
        GUI.Label(new Rect(70, 250, 200, 50), "Click This Texture to Save");
        if (GUI.Button(new Rect(50, 270, 200, 200), tex) && tex != null)
        {
            snapShot.SaveTextureToGallery(tex, ImageType.JPG);
        }


        if (GUI.Button(new Rect(Screen.width - 120, 10, 100, 40), "Next"))
        {
            UnityEngine.SceneManagement.SceneManager.LoadScene(2);
        }
    }
Exemplo n.º 3
0
    void OnGUI()
    {
        guiStyle.fontSize = 20;
        GUILayout.Label(log, guiStyle);
        if (GUI.Button(new Rect(20, 200, 150, 50), "Save Full Screen"))
        {
            // Saves image locally to C:\Users\gwany\Pictures\
            snapShot.CaptureAndSaveToAlbum(ImageType.JPG);
            // Saves image on device
            // snapShot.CaptureAndSaveAtPath(System.IO.Path.Combine(Application.persistentDataPath,"Image.jpg"),ImageType.JPG);
            // Save image to Assets folder
            // snapShot.CaptureAndSaveAtPath(Application.dataPath + "/Resources/AppImages/", ImageType.JPG);
        }

        if (GUI.Button(new Rect(200, 290, 170, 50), "Save in double resolution"))
        {
            snapShot.CaptureAndSaveToAlbum(Screen.width * 2, Screen.height * 2, Camera.main, ImageType.JPG);
        }

        GUI.Label(new Rect(20, 190, 500, 20), "------------------------------------------------------------------------------------------------------------------------------");

        GUI.Label(new Rect(20, 280, 50, 20), "X : ");
        x = GUI.TextField(new Rect(80, 280, 50, 20), x);

        GUI.Label(new Rect(160, 280, 50, 20), "Y : ");
        y = GUI.TextField(new Rect(200, 280, 50, 20), y);

        GUI.Label(new Rect(20, 310, 50, 20), "Width : ");
        width = GUI.TextField(new Rect(80, 310, 50, 20), width);

        GUI.Label(new Rect(150, 310, 50, 20), "Height : ");
        height = GUI.TextField(new Rect(200, 310, 50, 20), height);

        if (GUI.Button(new Rect(20, 340, 150, 50), "Save Selected Screen") && int.Parse(width) > 0 && int.Parse(height) > 0)
        {
            snapShot.CaptureAndSaveToAlbum(int.Parse(x), int.Parse(y), int.Parse(width), int.Parse(height), ImageType.JPG);
        }


        GUI.Label(new Rect(20, 410, 500, 20), "------------------------------------------------------------------------------------------------------------------------------");
        GUI.Label(new Rect(70, 430, 200, 50), "Click This Texture to Save");
        if (GUI.Button(new Rect(50, 450, 200, 200), tex) && tex != null)
        {
            snapShot.SaveTextureToGallery(tex, ImageType.JPG);
        }
    }
Exemplo n.º 4
0
    void OnGUI()
    {
        GUILayout.Label(log);

        if (GUI.Button(new Rect(Screen.width / 2 - 120, Screen.height - 120, 240, 120), "Save in double resolution"))
        {
            snapShot.CaptureAndSaveToAlbum(Screen.width * 2, Screen.height * 2, Camera.main, ImageType.JPG);
        }
    }
Exemplo n.º 5
0
    public void CapturePhoto()
    {
        uiToBeHidden.SetActive(false);
        uiToBeHidden2.SetActive(false);
        uiToBeHidden3.SetActive(false);
        uiToBeShown.SetActive(true);

        captureAndSave.CaptureAndSaveToAlbum();
        //captureAndSave.CaptureAndSaveAtPath(System.IO.Path.Combine(Application.persistentDataPath,"Image.jpg"),ImageType.JPG);
    }
Exemplo n.º 6
0
    public void CaptureSaveToAlbum()
    {
        // Saves image locally to C:\Users\gwany\Pictures\
        screenShotMger.ToggleCanvas("off");
        snapShot.CaptureAndSaveToAlbum(ImageType.PNG);

        // Saves image on device
        // snapShot.CaptureAndSaveAtPath(System.IO.Path.Combine(Application.persistentDataPath,"Image.jpg"),ImageType.JPG);
        // Save image to Assets folder
        // snapShot.CaptureAndSaveAtPath(Application.dataPath + "/Resources/AppImages/", ImageType.JPG);
    }
Exemplo n.º 7
0
    void OnGUI()
    {
        GUILayout.Label(log);

        if (GUI.Button(new Rect(Screen.width / 2 - 210, Screen.height - 120, 200, 120), "Save in double resolution"))
        {
            snapShot.CaptureAndSaveToAlbum(Screen.width * 2, Screen.height * 2, Camera.main, ImageType.JPG);
        }

        if (GUI.Button(new Rect(Screen.width / 2 + 30, Screen.height - 120, 200, 120), "Save with watermark"))
        {
            snapShot.CaptureAndSaveToAlbum(Screen.width, Screen.height, Camera.main, ImageType.JPG, watermark, WatermarkAlignment.BOTTOM_RIGHT);
        }


        if (GUI.Button(new Rect(Screen.width - 120, 10, 100, 40), "Next"))
        {
            UnityEngine.SceneManagement.SceneManager.LoadScene(1);
        }
    }
    void OnGUI()
    {
        GUILayout.Label(log);
        if (GUI.Button(new Rect(20, 20, 150, 50), "Save Full Screen"))
        {
            snapShot.CaptureAndSaveToAlbum();
            //snapShot.CaptureAndSaveAtPath(System.IO.Path.Combine(Application.persistentDataPath,"Image.jpg"));
        }

        if (GUI.Button(new Rect(200, 20, 170, 50), "Save in double resolution"))
        {
            snapShot.CaptureAndSaveToAlbum(Screen.width * 2, Screen.height * 2, Camera.main);
        }

        GUI.Label(new Rect(20, 70, 500, 20), "------------------------------------------------------------------------------------------------------------------------------");

        GUI.Label(new Rect(20, 100, 50, 20), "X : ");
        x = GUI.TextField(new Rect(80, 100, 50, 20), x);

        GUI.Label(new Rect(160, 100, 50, 20), "Y : ");
        y = GUI.TextField(new Rect(200, 100, 50, 20), y);

        GUI.Label(new Rect(20, 130, 50, 20), "Width : ");
        width = GUI.TextField(new Rect(80, 130, 50, 20), width);

        GUI.Label(new Rect(150, 130, 50, 20), "Height : ");
        height = GUI.TextField(new Rect(200, 130, 50, 20), height);

        if (GUI.Button(new Rect(20, 160, 150, 50), "Save Selected Screen") && int.Parse(width) > 0 && int.Parse(height) > 0)
        {
            snapShot.CaptureAndSaveToAlbum(int.Parse(x), int.Parse(y), int.Parse(width), int.Parse(height));
        }


        GUI.Label(new Rect(20, 230, 500, 20), "------------------------------------------------------------------------------------------------------------------------------");
        GUI.Label(new Rect(70, 250, 200, 50), "Click This Texture to Save");
        if (GUI.Button(new Rect(50, 270, 200, 200), tex) && tex != null)
        {
            snapShot.SaveTextureToGallery(tex);
        }
    }
Exemplo n.º 9
0
    IEnumerator delaySS(float delay)
    {
        buttonCapture.SetActive(false);
        yield return(new WaitForSeconds(delay));

        snapShot.CaptureAndSaveToAlbum();
        //snapShot.SaveTextureToGallery(tex);

        yield return(new WaitForSeconds(delay));

        buttonCapture.SetActive(true);
    }
Exemplo n.º 10
0
    public IEnumerator DoSaveToGallery()
    {
        // Wait till the last possible moment before screen rendering to hide the UI
        yield return(null);

        UICanvas.enabled = false;

        // Wait for screen rendering to complete
        yield return(new WaitForEndOfFrame());

        snapShotHelper.CaptureAndSaveToAlbum();

        //Wait for snap callback below
    }
Exemplo n.º 11
0
 public void fotocek()
 {
     uıgameobj.SetActive(false);
     captureandsave.CaptureAndSaveToAlbum();
 }
Exemplo n.º 12
0
 void TomarFoto()
 {
     snapShot.CaptureAndSaveToAlbum();
     Invoke("Activar", 1);
 }