BlazorExtensions / Canvas

HTML5 Canvas API implementation for Microsoft Blazor
MIT License
614 stars 146 forks source link

Support Draw image by image's url #74

Open zxyao145 opened 4 years ago

zxyao145 commented 4 years ago

Using canvas draw image by image's url, just like this:

function(url,weight,height,drawX,drawY){
  var img = new Image();
  img.src = url;
  img.width = weight;
  img.height = height;

  img.onload = function(){      
    context.drawImage(img,drawX,drawY);
  } 
 }

Therefore please add support for drawing image by url. Thanks a lot.