For a project, i have to load dynamic picture and use them into my game.
To do this i have simply create this little code :
public class ImageToTexture { public static Texture2D loadPictureFromFile(GraphicsDevice graph, String file) { Stream ss = new FileStream(file, FileMode.Open); Texture2D load = Texture2D.FromStream(graph, ss); return load; } }
No comments:
Post a Comment