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

      <legend id='jUUYB'><style id='jUUYB'><dir id='jUUYB'><q id='jUUYB'></q></dir></style></legend>
    1. <tfoot id='jUUYB'></tfoot>

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

        具有 HTML5 画布的更高 DPI 图形

        Higher DPI graphics with HTML5 canvas(具有 HTML5 画布的更高 DPI 图形)
        <legend id='DZ58E'><style id='DZ58E'><dir id='DZ58E'><q id='DZ58E'></q></dir></style></legend>
      1. <tfoot id='DZ58E'></tfoot>
        <i id='DZ58E'><tr id='DZ58E'><dt id='DZ58E'><q id='DZ58E'><span id='DZ58E'><b id='DZ58E'><form id='DZ58E'><ins id='DZ58E'></ins><ul id='DZ58E'></ul><sub id='DZ58E'></sub></form><legend id='DZ58E'></legend><bdo id='DZ58E'><pre id='DZ58E'><center id='DZ58E'></center></pre></bdo></b><th id='DZ58E'></th></span></q></dt></tr></i><div id='DZ58E'><tfoot id='DZ58E'></tfoot><dl id='DZ58E'><fieldset id='DZ58E'></fieldset></dl></div>

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

                  <bdo id='DZ58E'></bdo><ul id='DZ58E'></ul>

                    <tbody id='DZ58E'></tbody>
                  本文介绍了具有 HTML5 画布的更高 DPI 图形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在使用 HTML5 画布创建图像时,是否可以设置自定义 DPI/PPI?我知道如何在画布上绘制并将其导出为图像,但如何确保输出图像具有特定的 DPI/PPI.我想使用 SVG 元素在画布上绘制是一种方法,但是当我将整个画布导出为图像时,这不会变平吗?或者计算设备 DPI,然后缩放图像以满足我的 DPI 要求,但这似乎不是正确的解决方案.

                  Is there a way to set a custom DPI/PPI when creating an image using the HTML5 canvas? I know how can I draw on the canvas and export it as an image, but how can I make sure the output image is of certain DPI/PPI. I guess using SVG elemnts to draw on the canvas is a way, but wouldn't that be flattened out when I export the whole canvas as an image? Or calculating the device DPI and then scaling the image to meet my DPI requirement, but that doesn't seem like the correct solution.

                  推荐答案

                  你不能(呃)在任何浏览器中访问当前网页显示的 DPI:

                  You cannot (ugh) access the DPI of a display of the current web page in any browser:

                  从 JS/CSS 检测系统 DPI/PPI?

                  对于打印:您很可能无法使用浏览器标准函数设置导出的 图像(PNG、JPEG)的 DPI.但是,如果您使用纯 Javascript 编码器图像编码器,您可以自由创建任何类型的二进制文件,并手动调整嵌入在二进制文件中的 DPI 值.

                  For printing: You most likely cannot set the DPI of exported <canvas> image (PNG, JPEG) using browser standard functions. However, if you use a pure Javascript encoder image encoder you are free to create any sort of binary file you wish and manually adjust the DPI value embedded int he binary.

                  https://gist.github.com/1245476

                  这篇关于具有 HTML5 画布的更高 DPI 图形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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(我想沿特定路径对对象进行动画处理)
                  How to upload image into HTML5 canvas(如何将图像上传到 HTML5 画布中)
                • <tfoot id='gCMMU'></tfoot>
                    <tbody id='gCMMU'></tbody>
                  <i id='gCMMU'><tr id='gCMMU'><dt id='gCMMU'><q id='gCMMU'><span id='gCMMU'><b id='gCMMU'><form id='gCMMU'><ins id='gCMMU'></ins><ul id='gCMMU'></ul><sub id='gCMMU'></sub></form><legend id='gCMMU'></legend><bdo id='gCMMU'><pre id='gCMMU'><center id='gCMMU'></center></pre></bdo></b><th id='gCMMU'></th></span></q></dt></tr></i><div id='gCMMU'><tfoot id='gCMMU'></tfoot><dl id='gCMMU'><fieldset id='gCMMU'></fieldset></dl></div>
                  • <legend id='gCMMU'><style id='gCMMU'><dir id='gCMMU'><q id='gCMMU'></q></dir></style></legend>

                            <bdo id='gCMMU'></bdo><ul id='gCMMU'></ul>
                          • <small id='gCMMU'></small><noframes id='gCMMU'>