I am new to the web development world . I am trying to return a Bitmap Value from a web api to a javascript to be displayed on an HTML page but for some reason it is not doing so , here is my code :
in the webAPI :
public Bitmap gettestBitmap()
{
Bitmap theBM = new Bitmap(Properties.Resources._2_15_2013_5_08_48_PM);
return theBM;
}
in javascript , here is my code
var callstring = "api/Generator/gettestBitmap";
alert(callstring);
$.getJSON(callstring,
function (data) {
alert(data);
anImage.dataSrc = data;
})
.fail(
function (jqXHR, textStatus, err)
{
alert("All checks are correct, image was not
generated.\n jqXHR = " + jqXHR.responseText + "\n
textStatus=" + textStatus + " \n Error=" + err);});
the webAPI function gets called successfully and the data that comes back is System.Drawing.Bitmap and not the actual image
any clues how to fix this ?
Thanks!