Да, есть способ динамически генерировать и обслуживать изображения с помощью ASP.NET MVC.Вот пример:
public class HomeController : Controller
{
public ActionResult MyImage()
{
// Load an existing image
using (var img = Image.FromFile(Server.MapPath("~/test.png")))
using (var g = Graphics.FromImage(img))
{
// Use the Graphics object to modify it
g.DrawLine(new Pen(Color.Red), new Point(0, 0), new Point(50, 50));
g.DrawString("Hello World",
new Font(FontFamily.GenericSerif, 20),
new Pen(Color.Red, 2).Brush,
new PointF(10, 10)
);
// Write the resulting image to the response stream
using (var stream = new MemoryStream())
{
img.Save(stream, ImageFormat.Png);
return File(stream.ToArray(), "image/png");
}
}
}
}
А затем просто включите это изображение в представление:
<img src="<%= Url.Action("myimage", "home") %>" alt="my image" />