Reputation: 145
Am taking a snap and setting that image as background to other scene,but finally that background is showing a question marked image..
FYI the image already exists, i have checked that with File.exists(). and here is the code snippet i have used.
IEnumerator DisplayTexture() {
WWW www = new WWW(SelfiateUtils.SnapImagePath);
yield return www;
BGTexture.mainTexture = www.texture;
//Trace.text="Assaigned successfully";
if (www.error == null) {
}
}
SelfiateUtils.snapImage is the string url where i have saves the file.
can any one help me to fix this. thanks.. :)
Upvotes: 0
Views: 2601
Reputation: 331
Just to complement the answer in the comments and give it more visibility, as stated by Sharath, one must add "file://" as as prefix to load image files (jpg, jpg) in iOS.
This particularly important to remember when loading streaming assets. This prefix must be added before Application.streamingAssetsPath in iOS and also when running the app in the Unity Editor (Win and MacOS). In Android this prefix should be omitted.
Upvotes: 1