I have just reopened an old Monogame, windows- project, to continue working with it.
For some reason I can no longer run the project.
Texture2D texture = Texture2D.FromStream(Game1.CurrentGraphicsDevice, memoryStream);
fails with the message:"This image format is not supported".
It does this with PNG, GIF, JPG, so I am convinced it has nothing to do with the internal image format.
The inner exception is from MonoGame.Utilities.ImageReader.Read and states: "unknown image type".
On my machine, this minimal project can reproduce the problem. Can anyone confirm that it is a general problem, or just my setup?
public class Game1 : Game
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
protected override void LoadContent()
spriteBatch = new SpriteBatch(GraphicsDevice);
using (var stream = new System.IO.FileStream("c:\\temp\\test.jpg", FileMode.Open))
using (Bitmap img = (Bitmap)Bitmap.FromStream(stream))
var texture = Texture2D.FromStream(GraphicsDevice, stream);
Kind regards - Jakob