- Home /
Question by
huesihues · Nov 23, 2016 at 04:29 PM ·
screenshotmultiple-monitors
Black capture using Application.CaptureScreenshot with Multidisplay,
Hello, I'm using Multidisplay in my project and I need to take a ScreenShot with my display 1 and 2 as I choose. When I only have one display it works fine, but when I active my secondary camera, my screenshots turn black.
Anyone know how to fix it?
Thanks,,
Comment
here is my code: using UnityEngine; using System.Collections;
public class TakeScreenshot : $$anonymous$$onoBehaviour {
public int resolution = 3; // 1= default, 2= 2x default, etc.
public string imageName = "Screenshot_";
public string customPath = "C:/Users/default/Desktop/UnityScreenshots/"; // leave blank for project file location
public bool resetIndex = false;
//public testFileBrowser browser;
private int index = 0;
void Awake()
{
if (resetIndex)
{
PlayerPrefs.SetInt ("ScreenshotIndex", 0);
}
index = PlayerPrefs.GetInt("ScreenshotIndex") != 0 ? PlayerPrefs.GetInt("ScreenshotIndex") : 1;
}
public void Update()
{
if(Input.Get$$anonymous$$eyUp("q"))
{
TakePhoto$$anonymous$$anual ();
}
}
public void TakePhoto (string url)
{
/*if(url != "")
{
if(!System.IO.Directory.Exists(customPath))
{
System.IO.Directory.CreateDirectory(customPath);
}
}*/
Application.CaptureScreenshot(url+"/" + imageName + index + ".png", resolution);
index++;
Debug.LogWarning("Screenshot saved: " + url + " --- " + imageName + index);
}
public void TakePhoto$$anonymous$$anual ()
{
/*if(url != "")
{
if(!System.IO.Directory.Exists(customPath))
{
System.IO.Directory.CreateDirectory(customPath);
}
}*/
Application.CaptureScreenshot(customPath+"/" + imageName + index + ".png", resolution);
index++;
Debug.LogWarning("Screenshot saved: " + customPath + " --- " + imageName + index);
}
void OnApplicationQuit()
{
PlayerPrefs.SetInt("ScreenshotIndex", (index));
}
}
Your answer

Follow this Question
Related Questions
How to take screenshot of certain/all display(s) when using unity multi display (ie. 3 x display)? 0 Answers
iOS Xcode debug 0 Answers
Setting custom resolution then take screenshot 4 Answers
Getting screenshots within a loop? 2 Answers
How to save screenshot to a folder? (standalone player) (Window) 1 Answer