- Home /
File.ReadAllBytes does not work on mac ?
I'm simply trying to take a screenshot then load it in a byte array, but I get this error:
error CS0117: 'System.IO.File' does not contain a definition for 'ReadAllBytes'
any workarounds to make it work on mac too ?
my code is as simple as this:
Application.CaptureScreenshot("menu.png");
byte[] data = File.ReadAllBytes("menu.png");
bgImage.LoadImage(data);
note - bgImage is a Texture2D.
Answer by $$anonymous$$ · Jan 06, 2016 at 10:46 AM
The problem was my platform was set to Web Player instead of PC & Mac & Linux / Standalone. Hope I helped you if you had the same kind of problem.
Your answer
Follow this Question
Related Questions
Accessing the bytes[] from Application.CaptureScreenshot 1 Answer
Question about screenshots and facebook integration 1 Answer
Capture screenshot to texture, memory issue 1 Answer
Capturing 360 Image causes to darken the image and show ghosting and artifacts 0 Answers
Screen Cap as Transparent PNG without RenderTexture 0 Answers