I would like to get a .png.jpg image stored in local storage on my PC or Android and furthermore use it as a texture in the game.
So far I have been able to change the texture at runtime and get the path to the image from local storage.
But I’m not sure how to convert the local storage path to Texture2d.
I did some research and couldn’t find anything.
I know there is a function called DownloadImage that will allow me to turn an image from the web into texture2D.
I would like to do the same with images in local storage.
I would be glad to get some answers.
Thanks for reading to the end.
Hello @Russy_18, you should add this image file to your project. One way to do this is simply drag and drop the file into the Editor’s ContentBrowser inside the folder where you would like to save it. Unreal should then convert this file to a uasset where you will probably need to specify that it is a texture (I don’t remember if it detects it as a texture automatically or not).
Once the file is in the project’s content you can reference it and use it as you like inside your game.
Hope this helps, let me know if this solves your problem, good luck!
Thank you kribbeck!
sorry I may have been a little short in my description.
I want to get images from local storage on my PC or Android “at runtime.”
The use case is that I want to texture the image from the game user’s own PC or device.
What version of Unreal are you using? If you are using 4.27, there is now a plugin that does just what you are looking for:
If not, it looks like your best bet is to use the Image Wrapper Class using C++. Check out the following thread that looks to be more geared and has a solution to what you are looking for: