Advertisement
Guest User

Untitled

a guest
Jun 30th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.39 KB | None | 0 0
  1.     public void Screenshot()
  2.     {
  3.         //if you want to save on Application.persistentDataPath, file on this path is remove when app is uninstal
  4.         //string screenShotName = "AndroidUltimateScreenShot.png";
  5.         //string path = Application.persistentDataPath + "/" + screenShotName;
  6.  
  7.         string FileName = ScreenshotName + "-" + DateTime.Now.Year + DateTime.Now.Month +  DateTime.Now.Day + "-" + DateTime.Now.Hour + DateTime.Now.Minute + DateTime.Now.Second + ".jpg";
  8.         string folderPath = utilsPlugin.CreateFolder(utilsPlugin.GetDCIMPath() + "/RSToolKit", 0);
  9.         LastUsedPath = "";
  10.  
  11.         if (!folderPath.Equals("", StringComparison.Ordinal))
  12.         {
  13.             LastUsedPath = folderPath + "/" + FileName;
  14.  
  15.             //note: we added new required variable to pass which is screenShotName to determined what image format to use
  16.             //jpg or png, if format is not given set default to jpg format
  17.             StartCoroutine(AUP.Utils.TakeScreenshot(LastUsedPath, FileName));
  18.  
  19.             DialogManager.ShowAlert("The image has been saved! Would you like to share it?", ShareScreenshot, "Share", "Image Saved!", new ImageData(StandardIcon), null, "Cancel");
  20.  
  21.         }
  22.     }
  23.  
  24.     private void ShareScreenshot()
  25.     {
  26.         sharePlugin.ShareImage("RSToolkit Hiscores Graph", "check out this graph of hiscores I created using RSToolKit!", LastUsedPath);
  27.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement