나는 스크린 샷을 저장할 수 있고 나중에 표시 할 수있는 응용 프로그램을 만들고 있습니다. 내 코드가 정상적으로 실행되고 있으며, 스크린 샷이 저장되어 있고 문제없이 프로그램에 의해 수신 된 것 같습니다. 그러나 스크린 샷이 표시되지 않아 매우 실망 스럽습니다. 내 코드 :screenshot 캡처 및 표시
void OnGUI(){
if (GUI.Button (new Rect(940,y+25, Screen.width/30, Screen.height/14), Tex7)){
Debug.Log ("Selfie-maker");
folderPath = Application.persistentDataPath + "/screenshot.png";
Application.CaptureScreenshot(folderPath);
Debug.Log ("Screenshot number " + screenshotCount +" taken!");
screenshotCount ++;
}
if(GUI.Button (new Rect(940,y+65, Screen.width/30, Screen.height/14), Tex)){
Debug.Log ("Anders");
fileName = Path.Combine(Application.persistentDataPath, "screenshot.png");
bytes = File.ReadAllBytes(fileName);
screenshot = new Texture2D(0,0,TextureFormat.ATF_RGB_DXT1, false);
screenshot.LoadImage(bytes);
}
}
나는 제공 한 정보로 충분할 것입니다. 그렇지 않다면 주저하지 말고 물어보십시오.
당신의'screenshot' 객체에서 온 않는 경우도 http://answers.unity3d.com/ – sydan
에 게시하는 것은 좋은 생각이 될 수 있는가? 그것은 Unity'GameObject'입니까? –