How to load texture from path to XNA at runtime?

I'm trying to make an RPG editor in XNA, the thing is, I need to load the textures from the path written in the XMAL file.

I did some research, but most solutions change the content pipeline or just create your own.

+3
source share
1 answer

Try the following:

FileStream filestream = new FileStream("mytexture.jpg");
Texture2D myTexture = Texture2D.FromStream(graphicsDevice, filestream);

Texture2D.FromStream

Disclaimer: I have not tested this code (xna is not installed on this computer).

+3
source

All Articles