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

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

        <i id='gnNQa'><tr id='gnNQa'><dt id='gnNQa'><q id='gnNQa'><span id='gnNQa'><b id='gnNQa'><form id='gnNQa'><ins id='gnNQa'></ins><ul id='gnNQa'></ul><sub id='gnNQa'></sub></form><legend id='gnNQa'></legend><bdo id='gnNQa'><pre id='gnNQa'><center id='gnNQa'></center></pre></bdo></b><th id='gnNQa'></th></span></q></dt></tr></i><div id='gnNQa'><tfoot id='gnNQa'></tfoot><dl id='gnNQa'><fieldset id='gnNQa'></fieldset></dl></div>
      1. 将 html 5 画布图像保存在本地硬盘上

        Saving the html 5 canvas image on local harddrive(将 html 5 画布图像保存在本地硬盘上)
      2. <legend id='0k81z'><style id='0k81z'><dir id='0k81z'><q id='0k81z'></q></dir></style></legend><tfoot id='0k81z'></tfoot>

        <small id='0k81z'></small><noframes id='0k81z'>

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

                1. 本文介绍了将 html 5 画布图像保存在本地硬盘上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我使用 kineticjs 库在 html 5 画布上创建了形状.现在我想将画布保存为本地系统硬盘上的图像.请告诉我如何使用 KineticJS 库来实现它.

                  I had created shapes on html 5 canvas using kineticjs library. Now i want to save the canvas as an image on my local system harddrive. Pls tell me how can i achieve it by using KineticJS library.

                  推荐答案

                  选择画布后(我猜是使用 document.getElementById 之类的东西),您应该可以调用以下命令将画布转换为 dataURL.

                  After selecting the canvas (using something like document.getElementById I guess), you should be able to call the following to convert the canvas into a dataURL.

                  获得该 URL 后,在另一个浏览器窗口中打开它并执行标准的右键单击->将图像另存为,然后将其另存为 JPG/PNG/等格式.

                  Once you've got that URL, open it in another browser window and do a standard Right Click->Save Image As, and save it as a JPG/PNG/etc.

                  var canvas = document.getElementById("mycanvas");
                  var img    = canvas.toDataURL("image/png");
                  

                  您是否能够以编程方式将图像保存到驱动器,我不确定,但由于安全限制,我非常怀疑.

                  Whether or not you're able to save an image to the drive programmatically, I'm not sure, although I'd highly doubt it due to security constraints.

                  有关以编程方式访问文件系统的更多信息,请查看此 HTML5 文件系统参考站点.

                  For more information regarding programmatically accessing the File System, check out this HTML5 FileSystem reference site.

                  http://www.html5rocks.com/en/tutorials/file/filesystem/

                  有关检索 KinectJS Stage 画布元素的 dataURL 的更多信息,请参阅下面的代码片段/url.

                  For more information regarding retrieving a dataURL for a KinectJS Stage canvas element, see the below snippet / url.

                  <script>
                    stage.toDataURL({
                      callback: function(){
                        // do something with the data url
                      },
                      mimeType: 'image/jpeg',
                      quality: 0.5
                    });
                  </script>
                  

                  http://www.html5canvastutorials.com/kineticjs/html5-canvas-stage-data-url-with-kineticjs/

                  这篇关于将 html 5 画布图像保存在本地硬盘上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  How does object-fit work with canvas element?(对象适合如何与画布元素一起使用?)
                  How to make rooftext effect and valley text effect in HTML5 (or Fabric.js)(如何在 HTML5(或 Fabric.js)中制作屋顶文字效果和山谷文字效果)
                  Draw border around nontransparent part of image on canvas(在画布上的图像不透明部分周围绘制边框)
                  dragging and resizing an image on html5 canvas(在 html5 画布上拖动图像并调整其大小)
                  What#39;s the difference between a boolean as primitive and a boolean as property of an object?(作为原始对象的布尔值和作为对象属性的布尔值有什么区别?)
                  I want to do animation of an object along a particular path(我想沿特定路径对对象进行动画处理)

                  <tfoot id='D6DyB'></tfoot>

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

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

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