Friday, April 20, 2012

JavaScript to Convert Byte[] to Image in Html page [closed]

I'm creating one application to display the selected image from Windows Phone library to webpage. I have converted the choosen photo to byte[] and then string, passed to html page.



<script type="text/javascript">
function CallBack(jsonstring)
{
var bytes = [];
for (var i = 0; i < jsonstring.length; ++i)
{
bytes.push(jsonstring.charCodeAt(i));
}
var bMap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
document.getElementById('myimg').src =bMap;
}
</script>


But it is not working... getting unknown error.



Could anybody help me please!!!





No comments:

Post a Comment