- Home /
Possible to load image from desktop not url
Hi hope someone can help here, I know how to load an image from a URL but is it possible to load from a local file such as the C: Drive?
I cant find any reference at the moment and don't know if it is a security issue which is why you are unable to do so.
Any help would be appreciated.
thank you
Answer by AndyMartin458 · Jan 22, 2013 at 06:32 PM
are you trying to make a photo viewer? I think that it is certainly possible to do this, but typically you just want to drag the files into your project. A URL can also be used to load files. "http://www.myfile.com" would work about the same as "c:/users/me/myfile.jpg" I believe. You can even find files that are in your project folder using C# like this
string fileLocation = Application.dataPath + @"/Resources/mypic.jpg";
UPDATE: Will add my script's asap for other's to use, managed to get the image to save inside the applications folder, and load it in real time as a texture.
Answer by 199christoff · Jan 22, 2013 at 09:43 PM
Thank you, Il try this now and let you know what happens.
What I am trying to achieve is a system where the user can take a photo of them self for use within the game. I have the webcam and photo function working, but didn't have any look when it came to loading the file to my texture.
I will try your solution now and see it works, appreciate the help.
I'm not at a computer where I can test any of that for you.
Thanks since then I have been able to fix my problems and get it working, il upload the scripts so others can use them asap!
but thank you for your help, it put me on the right path.
Answer by Chintan-Kansagara · Aug 02, 2017 at 11:33 AM
Hi. someone can help here, i am current working in wallpaper app development in unity3d platfrom -- Possible to load image from url and Set image as wallpaper