Search code examples
c#xnatexturesloading

How can i load bigger textures than 4096*4096 in xna?


I want to load tilesets into xna using Texture2D.FromStream(...), that are bigger than 4096*4096 and there are many of them so i don't want to crop each of them manually.

Can i load them anyway? And if not, is it possible to load a texture partially?


Solution

  • You can't get around loading the max size of a texture in XNA. Your best bet is loading it as a bitmap using System.Drawing.Bitmap and resizing it as a bitmap then load it as a texture.