- Home /
Loading Pictures from Android Device into game at runtime
Hey I am fairly new to unity and would like some help on a demo I am creating. It involves taking a picture with the Application.CaputreScreenshot() and with that screenshot pulling the picture from the device and applied onto a plane as a texture during runtime.
I am able to take the screenshot easily and it is saved on the device under sdcard/Android/com.company.appname/files my next step is to try and pull this picture out.
I've tried using load resources but loadresources only works if the picture is already there before the application is installed onto the device. My next step is trying to use new WWW ("file://picture.png"); After I capture the file like this Application.CaptureScreenshot("picture.png"); It won't let me pull the material by using www = new WWW ("file://arScene.png");
Does anyone have any suggestions on how I can pull this picture out. Maybe I am not using the WWW class correctly?
Answer by Ashkan_gc · Mar 29, 2013 at 02:09 PM
What error do you get? If you have access to SD in your app which you have cause you are writing to it, then after getting it with WWW and yielding for it to complete, then with WWW.LoadImage or LoadTexture (don't remember now) you should be able to make a texture from it.