mardi 7 avril 2015

How to load image from Content folder in ASP.NET MVC5?

I'm having a WebAPI project (MVC5) and just put an image in Content/Images. I'd like to load this image in C# and edit some stuff on runtime:



string originalFileName = "/Content/Images/Image.png";

Bitmap bitmap = new Bitmap(originalFileName);
Graphics g = Graphics.FromImage(bitmap);


This does not work unfortunatly, I'm getting an exception: System.ArgumentException - >Parameter is not valid.


My setup (code view left, solution explorer right): enter image description here


Aucun commentaire:

Enregistrer un commentaire