Can I upload an image to an XNA game from a user computer? For example, I want to download "C: \ Images \ Box.png" to create a texture. Is it possible? If so, how?
In XNA 4.0 use Texture2D.FromStream
Texture2D.FromStream
Texture2D fileTexture; using(FileStream fileStream = new FileStream(@"C:\Images\Box.png", FileMode.Open)) { fileTexture = Texture2D.FromStream(GraphicsDevice, fileStream); }
If you use XNA before 4.0, you can use Texture2D.FromFile .
Texture2D.FromFile
System.IO.FileStream stream = new System.IO.FileStream(@"C:\Images\Box.png", System.IO.FileMode.Open); Texture2D texture = Texture2D.FromStream(GraphicsDevice, stream);
Source: https://habr.com/ru/post/900713/More articles:C # delegate effect in xna - performanceValgrind error when printing selected lines - cIs there a good explanation of what ASP.NET MVC3 does with its ajax helpers and rendering unobtrusive javascript? - asp.netCan this be done on one line? - perlC # Open dbf file - c #Why am I getting a "No Attribute" error message for a Match Locator error when publishing? - visual-studio-2010programmatically add a hyperlink to listitem - htmlA well-known algorithm for efficiently distributing items and meeting lows? - language-agnosticiOS Stream Audio from Cookie Server - iosDoes Android browser report incorrect screen size? - androidAll Articles