• <i id='yb8Q1'><tr id='yb8Q1'><dt id='yb8Q1'><q id='yb8Q1'><span id='yb8Q1'><b id='yb8Q1'><form id='yb8Q1'><ins id='yb8Q1'></ins><ul id='yb8Q1'></ul><sub id='yb8Q1'></sub></form><legend id='yb8Q1'></legend><bdo id='yb8Q1'><pre id='yb8Q1'><center id='yb8Q1'></center></pre></bdo></b><th id='yb8Q1'></th></span></q></dt></tr></i><div id='yb8Q1'><tfoot id='yb8Q1'></tfoot><dl id='yb8Q1'><fieldset id='yb8Q1'></fieldset></dl></div>

  • <legend id='yb8Q1'><style id='yb8Q1'><dir id='yb8Q1'><q id='yb8Q1'></q></dir></style></legend>
  • <tfoot id='yb8Q1'></tfoot>

      <small id='yb8Q1'></small><noframes id='yb8Q1'>

      • <bdo id='yb8Q1'></bdo><ul id='yb8Q1'></ul>

        在 javascript/jquery 中将 base64 转换为图像

        convert base64 to image in javascript/jquery(在 javascript/jquery 中将 base64 转换为图像)

        <small id='ZsTKS'></small><noframes id='ZsTKS'>

              <tbody id='ZsTKS'></tbody>

            <i id='ZsTKS'><tr id='ZsTKS'><dt id='ZsTKS'><q id='ZsTKS'><span id='ZsTKS'><b id='ZsTKS'><form id='ZsTKS'><ins id='ZsTKS'></ins><ul id='ZsTKS'></ul><sub id='ZsTKS'></sub></form><legend id='ZsTKS'></legend><bdo id='ZsTKS'><pre id='ZsTKS'><center id='ZsTKS'></center></pre></bdo></b><th id='ZsTKS'></th></span></q></dt></tr></i><div id='ZsTKS'><tfoot id='ZsTKS'></tfoot><dl id='ZsTKS'><fieldset id='ZsTKS'></fieldset></dl></div>

              <bdo id='ZsTKS'></bdo><ul id='ZsTKS'></ul>
              <legend id='ZsTKS'><style id='ZsTKS'><dir id='ZsTKS'><q id='ZsTKS'></q></dir></style></legend>
            • <tfoot id='ZsTKS'></tfoot>

                  本文介绍了在 javascript/jquery 中将 base64 转换为图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我已经编写了一些使用 javascript/jquery 进行图像捕获的代码下面是代码:

                  I have written some code for image capturing using javascript/jquery Below is the code:

                  function capture_image(){ 
                      alert("capture_image");
                      var p = webcam.capture();
                      webcam.save();           
                      alert("capture complete "+p); //getting true here
                  
                  
                       var img = canvas.toDataURL("image");
                      var item_image = img.replace(/^data:image/(png|jpg);base64,/, "") ; 
                      alert("item_image"+item_image);
                  }
                  

                  item_image 打印 base64 格式,如何将该 base64 转换为图像以及如何在 javascript 客户端中使用该路径.

                  The item_image print the base64 format, How to convert that base64 to image and how to use that path in javascript clientside.

                  我正在谷歌搜索这么多网站,但它无法正常工作,并且该代码不适合我的要求.

                  Am searching google so many websites but its not working and that code is not suitable for my requirement.

                  推荐答案

                  你可以只创建一个 Image 对象并将 base64 作为它的 src,包括 >data:image... 部分 像这样:

                  You can just create an Image object and put the base64 as its src, including the data:image... part like this:

                  var image = new Image();
                  image.src = 'data:image/png;base64,iVBORw0K...';
                  document.body.appendChild(image);
                  

                  这就是他们所说的数据 URI",这里是 兼容性表,让您内心平静.

                  It's what they call "Data URIs" and here's the compatibility table for inner peace.

                  这篇关于在 javascript/jquery 中将 base64 转换为图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  在开发JS过程中,会经常遇到两个小数相运算的情况,但是运算结果却与预期不同,调试一下发现计算结果竟然有那么长一串尾巴。如下图所示: 产生原因: JavaScript对小数运算会先转成二进制,运算完毕再转回十进制,过程中会有丢失,不过不是所有的小数间运算会
                  append() 方法在被选元素的结尾(仍然在内部)插入指定内容。 语法: $(selector).append( content ) var creatPrintList = function(data){ var innerHtml = ""; for(var i =0;i data.length;i++){ innerHtml +="li class='contentLi'"; innerHtml +="a href
                  问题描述: 在javascript中引用js代码,然后导致反斜杠丢失,发现字符串中的所有\信息丢失。比如在js中引用input type=text onkeyup=value=value.replace(/[^\d]/g,) ,结果导致正则表达式中的\丢失。 问题原因: 该字符串含有\,javascript对字符串进行了转
                  Rails/Javascript: How to inject rails variables into (very) simple javascript(Rails/Javascript:如何将 rails 变量注入(非常)简单的 javascript)
                  CoffeeScript always returns in anonymous function(CoffeeScript 总是以匿名函数返回)
                  Ordinals in words javascript(javascript中的序数)

                  <small id='Fg2qN'></small><noframes id='Fg2qN'>

                  <tfoot id='Fg2qN'></tfoot>

                    <bdo id='Fg2qN'></bdo><ul id='Fg2qN'></ul>
                    • <legend id='Fg2qN'><style id='Fg2qN'><dir id='Fg2qN'><q id='Fg2qN'></q></dir></style></legend>

                          <tbody id='Fg2qN'></tbody>
                            <i id='Fg2qN'><tr id='Fg2qN'><dt id='Fg2qN'><q id='Fg2qN'><span id='Fg2qN'><b id='Fg2qN'><form id='Fg2qN'><ins id='Fg2qN'></ins><ul id='Fg2qN'></ul><sub id='Fg2qN'></sub></form><legend id='Fg2qN'></legend><bdo id='Fg2qN'><pre id='Fg2qN'><center id='Fg2qN'></center></pre></bdo></b><th id='Fg2qN'></th></span></q></dt></tr></i><div id='Fg2qN'><tfoot id='Fg2qN'></tfoot><dl id='Fg2qN'><fieldset id='Fg2qN'></fieldset></dl></div>