I'm new to asp.net mvc, but I'm trying to do an funny app with GDI+ and I need to do some image view with asp.net mvc.
I have a Model which has an image property:
namespace DomainModel.Entities
{
public class BackgroundImage
{
// Properties
public Image Image {get; private set; }
public BackgroundImage()
{
Image = Image.FromFile(@"D:\ProjectZero\DomainModel\image\bkg.PNG");
}
}
}
The controller sends to the view the following:
public ActionResult Index()
{
BackgroundImage bkImg = new BackgroundImage();
return View(bkImg);
}
The view looks like this:
<p> Height: </p><%= Model.Image.Height //it prints the height of the image %> </br>
<p> Width: </p><%= Model.Image.Width //it prints the width %> </br>
<p> Image: </p><%= Model.Image //does not work to display the image %>
How do I display that image property?
I need that background image for a div. I do not need to resize the image, I only need to display it in it's normal size.
Is there a Html Helper that I miss?
Thank you, for your time!