title: Controller return image for use in browser
body: <p>I am attempting to convert an existing WinForms application to a MVC Web Application.</p>
  
  <p>I am attempting to display an image from a controller.</p>
  
  <p>At the moment I get a System.Drawing.Image back from a function and I am trying to work out how to supply this to the View.</p>
  
  <p>This is my controller:</p>
  
  <pre><code>public System.Drawing.Image getStudentImage(string PersonID)
  {
          System.Drawing.Image studentImage = ClientFunctions.GetStudentImage(GlobalVariables.networkstuff, GlobalVariables.testAuth, PersonID);
          return studentImage;
  }
  </code></pre>
  
  <p>And then, in my View I would like to display this image...</p>
  
  <p>Hopefully, like this:</p>
  
  <pre><code>&lt;img id="@pupil.PupilInfo.PersonID" src="~/TakeRegister/getStudentImage/@pupil.PupilInfo.PersonID" alt="" /&gt;
  </code></pre>
  
  <p>When I run the code I get broken images in the browser and when I look at the "src" of the image it looks like this:</p>
  
  <pre><code>http://localhost:19340/TakeRegister/getStudentImage/3058
  </code></pre>
  
  <p>I get the feeling I am doing more than 1 thing wrong here... (?)</p>
  
  <p>Can anyone give me any pointers please?</p>