Search code examples
c#visual-studio-2010xnaxna-4.0

Can we update XNA to render any new image added in database


I have created an application on XNA 4.0. The application is displaying images that are added in the database. I want to ask that is it possible to live updae XNA application if i add more images into the database. Would it show those images or i have to restart application to view new inserted items. Kindly tell me the possible way to update XNA screen Live.


Solution

  • Load your new textures using Texture2D.FromStream http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.graphics.texture2d.fromstream.aspx

    The stream can be any .Net stream so it can come from a file or memory stream. If you have a binary blob from a database you can make a memory stream from that using this overload http://msdn.microsoft.com/en-us/library/e55f3s5k(v=vs.110).aspx