createImageBitmap function polyfill with ImageData

Edge browser does not contain createBitmapImage function.

if you want to use it with ImageData

you can use this function as polyfill with typescript


Window.prototype.createImageBitmap = function(imageData):Promise{

return new Promise((resolve,reject)=>{

let canvas=document.createElement('canvas');
canvas.width=imageData.width;
canvas.height=imageData.height;
let context= canvas.getContext("2d");
context.putImageData(imageData,0,0);
return resolve(canvas);

});

}