Search Unity

How to take screen shot or save screen?

Discussion in 'Scripting' started by bekiryanik, Jul 16, 2014.

  1. bekiryanik

    bekiryanik

    Joined:
    Jul 6, 2014
    Posts:
    191
    Hello,

    I am working on a project and in this project i need to do something like, saving screen in smartphone's library or taking a part of this screen's screen shot and save this screen shot in smartphone's library. There will be a button in screen, when player press on this button, the screen shot / save will work. Any idea how can i do that?
     
  2. Philip-Rowlands

    Philip-Rowlands

    Joined:
    May 13, 2013
    Posts:
    353
    You can capture screenshots using Application.CaptureScreenshot, which will create a PNG file. If you want to capture multiple screenshots, without overwriting the previous one, I'd write it as follows
    (C#)
    Code (csharp):
    1.  
    2.  
    3. if (GUI.Button("Take screenshot") )
    4. {
    5.     DateTime currentDate = DateTime.Now;
    6.     Application.CaptureScreenshot("Screenshot " + currentDate.ToString());
    7. }
    8.  
     
    Last edited: Jul 16, 2014
  3. bekiryanik

    bekiryanik

    Joined:
    Jul 6, 2014
    Posts:
    191
    Okay, thank you.
     
  4. eyeglasses

    eyeglasses

    Joined:
    Aug 4, 2015
    Posts:
    10
    were does it save screen shot to plz
     
  5. bekiryanik

    bekiryanik

    Joined:
    Jul 6, 2014
    Posts:
    191
    It saves it to the gallery but sometimes you should restart your phone to see the screen shot.