image upload using javascript Archives - Microsoft Dynamics 365 Blog http://microsoftdynamics.in/category/image-upload-using-javascript/ Microsoft Dynamics CRM . Microsoft Power Platform Tue, 01 Sep 2015 12:00:00 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/04/cropped-Microsoftdynamics365-blogs.png?fit=32%2C32 image upload using javascript Archives - Microsoft Dynamics 365 Blog http://microsoftdynamics.in/category/image-upload-using-javascript/ 32 32 176351444 Convert Image file to stream / base64Image using javascript / jquery . http://microsoftdynamics.in/2015/09/01/convert-image-file-to-stream-base64image-using-javascript-jquery/ Tue, 01 Sep 2015 12:00:00 +0000 http://microsoftdynamics.in/2015/09/01/convert-image-file-to-stream-base64image-using-javascript-jquery/ 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”);    ...

The post Convert Image file to stream / base64Image using javascript / jquery . appeared first on Microsoft Dynamics 365 Blog.

]]>
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

The post Convert Image file to stream / base64Image using javascript / jquery . appeared first on Microsoft Dynamics 365 Blog.

]]>
2794