Please wait, loading...

 
Below Code convert the image file to base64 which can be used to compare image etc .

 var imgvar = new Image();
        imgvar.src = SourceOfFile;
        imgvar.onload = function () {              
         var canvas = document.createElement(“canvas”);
         canvas.width = this.width;
         canvas.height = this.height;
     
         var ctx = canvas.getContext(“2d”);
         ctx.drawImage(this, 0, 0);
         var dataURL = canvas.toDataURL(“image/png”);
      var base64Image = dataURL.replace(/^data:image/(png|jpg);base64,/, “”);
Thanks

SOURCE : JUST2CODE.IN Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/04/Microsoftdynamics365.png?fit=640%2C651
Microsoft Dynamics Community Profile

Learn more