{"id":106556,"date":"2026-09-17T16:32:36","date_gmt":"2026-09-17T08:32:36","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/106556.html"},"modified":"2026-09-17T16:32:36","modified_gmt":"2026-09-17T08:32:36","slug":"canvas-%e6%b8%b2%e6%9f%93%e9%ab%98-dpi-%e5%b1%8f%e5%b9%95%e4%b8%8b%e7%9a%84%e6%a8%a1%e7%b3%8a%e6%b2%bb%e7%90%86%e4%b8%8e%e4%bc%98%e5%8c%96","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/106556.html","title":{"rendered":"Canvas \u6e32\u67d3\u9ad8 DPI \u5c4f\u5e55\u4e0b\u7684\u6a21\u7cca\u6cbb\u7406\u4e0e\u4f18\u5316"},"content":{"rendered":"<h2>Canvas \u6e32\u67d3\u9ad8 DPI \u5c4f\u5e55\u4e0b\u7684\u6a21\u7cca\u6cbb\u7406\u4e0e\u4f18\u5316<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260917083234-6aaba5a28b8b6.webp\" alt=\"\u5c01\u9762\u4fe1\u606f\u56fe\" \/><\/p>\n<p>\u5728\u6570\u636e\u53ef\u89c6\u5316\u548c\u56fe\u8868\u7ed8\u5236\u4e2d&#xff0c;\u524d\u7aef\u5de5\u7a0b\u5e08\u6700\u5e38\u6536\u5230\u7684\u89c6\u89c9 Bug \u53cd\u9988\u4e4b\u4e00\u5c31\u662f&#xff1a;\u201c\u5728 MacBook Retina \u5c4f\u6216 4K \u9ad8\u5237\u5c4f\u4e0a&#xff0c;Canvas \u7ed8\u5236\u7684\u6298\u7ebf\u3001\u6587\u5b57\u548c\u5706\u70b9\u8fb9\u7f18\u53d1\u865a&#xff0c;\u5b9b\u5982\u88ab\u8499\u4e0a\u4e86\u4e00\u5c42\u6bdb\u73bb\u7483\u201d\u3002\u800c\u5982\u679c\u4ec5\u4ec5\u7167\u672c\u5ba3\u79d1\u5730\u5c06 Canvas \u5c3a\u5bf8\u65e0\u8111\u653e\u5927 3 \u500d\u6216 4 \u500d&#xff0c;\u53c8\u6781\u6613\u5f15\u53d1\u79fb\u52a8\u7aef\u6216\u4f4e\u914d\u8bbe\u5907\u7684\u663e\u5b58\u8d85\u9650&#xff08;OOM&#xff09;\u3001\u6389\u5e27\u4ee5\u53ca\u5750\u6807\u7cfb\u7edf\u9519\u4f4d\u7684\u8fde\u9501\u53cd\u5e94\u3002<\/p>\n<p>\u6cbb\u7406\u9ad8 DPI \u5c4f\u5e55\u4e0b\u7684 Canvas \u6a21\u7cca&#xff0c;\u4e0d\u4ec5\u662f\u4e00\u6b21\u50cf\u7d20\u6362\u7b97&#xff0c;\u66f4\u662f\u4e00\u573a\u517c\u987e\u89c6\u7f51\u819c\u6e05\u6670\u5ea6\u4e0e\u6e32\u67d3\u663e\u5b58\u5e73\u8861\u7684\u7cbe\u5bc6\u63a7\u5236\u3002<\/p>\n<h4>\u6839\u56e0\u5256\u6790&#xff1a;\u903b\u8f91\u50cf\u7d20\u4e0e\u7269\u7406\u7f51\u683c\u7684\u9519\u4f4d<\/h4>\n<p>Canvas \u672c\u8d28\u4e0a\u662f\u4e00\u5757\u7531\u7269\u7406\u70b9\u9635\u6784\u6210\u7684\u4f4d\u56fe\u7f13\u51b2\u533a&#xff08;Bitmap Buffer&#xff09;\u3002\u5b83\u5305\u542b\u4e24\u5957\u5b8c\u5168\u72ec\u7acb\u7684\u5c3a\u5bf8\u5c5e\u6027&#xff1a;<\/p>\n<li>\u753b\u5e03\u5185\u5728\u50cf\u7d20\u5c3a\u5bf8&#xff08;Drawing Buffer Size&#xff09;&#xff1a;\u7531 HTML \u5c5e\u6027 canvas.width \u4e0e canvas.height \u51b3\u5b9a\u3002<\/li>\n<li>\u753b\u5e03\u6837\u5f0f\u663e\u793a\u5c3a\u5bf8&#xff08;CSS Display Size&#xff09;&#xff1a;\u7531 CSS \u6837\u5f0f canvas.style.width \u4e0e canvas.style.height \u51b3\u5b9a\u3002<\/li>\n<p>\u5f53\u5c4f\u5e55\u8bbe\u5907\u50cf\u7d20\u6bd4 window.devicePixelRatio &#061; 2 \u65f6&#xff0c;1 \u4e2a CSS \u903b\u8f91\u50cf\u7d20\u5b9e\u9645\u4e0a\u7531 $2 \\\\times 2 &#061; 4$ \u4e2a\u7269\u7406\u53d1\u5149\u70b9\u5448\u73b0\u3002\u5982\u679c\u6b64\u65f6 canvas.width \u4e0e canvas.style.width \u5747\u4e3a 500px&#xff0c;\u6d4f\u89c8\u5668\u5408\u6210\u5668\u4e3a\u4e86\u586b\u6ee1 1000px \u7684\u7269\u7406\u5c4f\u5e55\u50cf\u7d20&#xff0c;\u5c31\u4f1a\u5f3a\u884c\u5bf9\u8fd9\u5f20 500px \u7684\u4f4d\u56fe\u6267\u884c\u53cc\u7ebf\u6027\u63d2\u503c\u653e\u5927&#xff08;Bilinear Interpolation&#xff09;&#xff0c;\u5bfc\u81f4\u6e05\u6670\u7684\u77e2\u91cf\u8fb9\u7f18\u6ca6\u4e3a\u6bdb\u7cd9\u7684\u6e10\u53d8\u6a21\u7cca\u3002<\/p>\n<h4>\u6807\u51c6\u6cbb\u7406\u6a21\u578b\u4e0e\u5750\u6807\u7cfb\u5bf9\u9f50<\/h4>\n<p>\u6807\u51c6\u7684\u89e3\u51b3\u601d\u8def\u662f&#xff1a;\u5c06\u4f4d\u56fe\u5185\u5728\u5206\u8fa8\u7387\u7b49\u6bd4\u653e\u5927\u81f3\u7269\u7406\u50cf\u7d20\u5927\u5c0f&#xff0c;\u518d\u901a\u8fc7 CSS \u6837\u5f0f\u5c06\u5176\u7ea6\u675f\u5728\u903b\u8f91\u5c3a\u5bf8&#xff0c;\u6700\u540e\u5728 2D \u7ed8\u56fe\u4e0a\u4e0b\u6587\u4e2d\u5e94\u7528\u7f29\u653e\u53d8\u6362&#xff0c;\u4f7f\u7528\u6237\u4ee3\u7801\u5b8c\u5168\u6cbf\u7528\u903b\u8f91\u50cf\u7d20\u5750\u6807\u4f53\u7cfb\u7f16\u5199\u3002<\/p>\n<p>export class HiDPICanvas {<br \/>\n  public canvas: HTMLCanvasElement;<br \/>\n  public ctx: CanvasRenderingContext2D;<br \/>\n  private dpr: number &#061; 1;<br \/>\n  private maxDpr: number;<\/p>\n<p>  constructor(canvas: HTMLCanvasElement, maxDpr: number &#061; 2) {<br \/>\n    this.canvas &#061; canvas;<br \/>\n    const context &#061; canvas.getContext(&#039;2d&#039;);<br \/>\n    if (!context) throw new Error(&#039;Failed to get 2D context&#039;);<br \/>\n    this.ctx &#061; context;<br \/>\n    this.maxDpr &#061; maxDpr;<\/p>\n<p>    this.resize();<br \/>\n    this.bindDisplayChangeWatcher();<br \/>\n  }<\/p>\n<p>  \/**<br \/>\n   * \u5c3a\u5bf8\u4e0e\u50cf\u7d20\u6bd4\u91cd\u7f6e<br \/>\n   *\/<br \/>\n  public resize(customWidth?: number, customHeight?: number): void {<br \/>\n    \/\/ \u94b3\u5236 DPR \u6700\u5927\u503c&#xff0c;\u9632\u6b62\u8d85\u9ad8\u5206\u5c4f&#xff08;\u5982 3x\/4x&#xff09;\u9020\u6210\u663e\u5b58\u66b4\u589e\u4e0e\u6027\u80fd\u8870\u51cf<br \/>\n    this.dpr &#061; Math.min(window.devicePixelRatio || 1, this.maxDpr);<\/p>\n<p>    const rect &#061; this.canvas.getBoundingClientRect();<br \/>\n    const displayWidth &#061; customWidth ?? rect.width ?? 300;<br \/>\n    const displayHeight &#061; customHeight ?? rect.height ?? 150;<\/p>\n<p>    \/\/ 1. \u8bbe\u7f6e\u4f4d\u56fe\u5185\u5728\u5206\u8fa8\u7387<br \/>\n    this.canvas.width &#061; Math.round(displayWidth * this.dpr);<br \/>\n    this.canvas.height &#061; Math.round(displayHeight * this.dpr);<\/p>\n<p>    \/\/ 2. \u9501\u5b9a CSS \u903b\u8f91\u5c3a\u5bf8<br \/>\n    this.canvas.style.width &#061; &#096;${displayWidth}px&#096;;<br \/>\n    this.canvas.style.height &#061; &#096;${displayHeight}px&#096;;<\/p>\n<p>    \/\/ 3. \u7f29\u653e\u7ed8\u56fe\u4e0a\u4e0b\u6587\u5750\u6807\u7cfb&#xff0c;\u4f7f\u5f97\u4e1a\u52a1\u7ed8\u5236\u4ee3\u7801\u4fdd\u6301\u7eaf\u903b\u8f91\u5750\u6807<br \/>\n    this.ctx.resetTransform?.() || this.ctx.setTransform(1, 0, 0, 1, 0, 0);<br \/>\n    this.ctx.scale(this.dpr, this.dpr);<br \/>\n  }<\/p>\n<p>  \/**<br \/>\n   * \u76d1\u542c\u8de8\u5c4f\u62d6\u62fd\u65f6\u7684 DPR \u52a8\u6001\u53d8\u5316<br \/>\n   *\/<br \/>\n  private bindDisplayChangeWatcher(): void {<br \/>\n    const mediaQuery &#061; window.matchMedia(&#096;(resolution: ${window.devicePixelRatio}dppx)&#096;);<br \/>\n    const handleChange &#061; () &#061;&gt; {<br \/>\n      this.resize();<br \/>\n      \/\/ \u89e6\u53d1\u5916\u90e8\u91cd\u7ed8\u56de\u8c03<br \/>\n      this.onRedrawNeeded?.();<br \/>\n      this.bindDisplayChangeWatcher(); \/\/ \u91cd\u65b0\u7ed1\u5b9a\u65b0\u7684 DPR \u76d1\u542c\u5668<br \/>\n    };<br \/>\n    mediaQuery.addEventListener(&#039;change&#039;, handleChange, { once: true });<br \/>\n  }<\/p>\n<p>  public onRedrawNeeded?: () &#061;&gt; void;<br \/>\n}<\/p>\n<h4>1 \u50cf\u7d20\u7269\u7406\u5bf9\u9f50&#xff08;Pixel Snapping&#xff09;\u4e0e\u6297\u952f\u9f7f<\/h4>\n<p>\u5373\u4f7f\u5728\u914d\u7f6e\u4e86\u9ad8 DPR \u540e&#xff0c;\u8bb8\u591a\u5de5\u7a0b\u5e08\u5728\u7ed8\u5236 1 \u50cf\u7d20\u7684\u7cbe\u7ec6\u7f51\u683c\u7ebf\u65f6&#xff0c;\u4f9d\u7136\u4f1a\u53d1\u73b0\u7ebf\u6761\u53d1\u7070\u53d8\u7c97&#xff08;\u53d8\u6210\u4e86 2 \u50cf\u7d20\u5bbd&#xff09;\u3002<\/p>\n<p>\u8fd9\u662f\u56e0\u4e3a Canvas \u7684\u8def\u5f84\u5c45\u4e2d\u7ed8\u5236\u673a\u5236&#xff1a;\u5f53\u4f60\u5728\u6574\u6570\u5750\u6807 x &#061; 10 \u5904\u7ed8\u5236\u4e00\u6761\u5bbd\u5ea6\u4e3a 1 \u7684\u7ad6\u7ebf\u65f6&#xff0c;Canvas \u4f1a\u5c06\u7ebf\u5bbd\u5747\u5206\u5230\u4e24\u8fb9&#xff0c;\u5373\u7ed8\u5236\u8303\u56f4\u4e3a [9.5, 10.5]\u3002\u7531\u4e8e\u843d\u5728\u4e86\u4e24\u4e2a\u50cf\u7d20\u5355\u5143\u4e4b\u95f4&#xff0c;\u6297\u952f\u9f7f\u5f15\u64ce\u4f1a\u5bf9\u76f8\u90bb\u7684\u4e24\u4e2a\u50cf\u7d20\u70b9\u5404\u586b\u5145 50% \u7684\u4e0d\u900f\u660e\u5ea6&#xff0c;\u5bfc\u81f4\u7ebf\u6761\u6cdb\u767d\u53d1\u865a\u3002<\/p>\n<p>\u5bf9\u9f50\u65b9\u6848&#xff1a;\u5bf9\u4e8e\u5947\u6570\u7ebf\u5bbd&#xff08;1px\u30013px&#xff09;&#xff0c;\u5728\u7ed8\u5236\u65f6\u5fc5\u987b\u4e3a\u5750\u6807\u589e\u52a0 0.5 \u50cf\u7d20\u7684\u7269\u7406\u5bf9\u9f50\u504f\u79fb\u91cf&#xff08;Snapping Offset&#xff09;&#xff1a;<\/p>\n<p>export function drawCrispLine(<br \/>\n  ctx: CanvasRenderingContext2D,<br \/>\n  x1: number,<br \/>\n  y1: number,<br \/>\n  x2: number,<br \/>\n  y2: number,<br \/>\n  lineWidth: number &#061; 1<br \/>\n): void {<br \/>\n  ctx.save();<br \/>\n  ctx.lineWidth &#061; lineWidth;<br \/>\n  \/\/ \u5947\u6570\u7ebf\u5bbd\u8fdb\u884c\u534a\u50cf\u7d20\u5e73\u79fb<br \/>\n  const offset &#061; (lineWidth % 2 &#061;&#061;&#061; 1) ? 0.5 : 0;<\/p>\n<p>  ctx.beginPath();<br \/>\n  ctx.moveTo(Math.floor(x1) &#043; offset, Math.floor(y1) &#043; offset);<br \/>\n  ctx.lineTo(Math.floor(x2) &#043; offset, Math.floor(y2) &#043; offset);<br \/>\n  ctx.stroke();<br \/>\n  ctx.restore();<br \/>\n}<\/p>\n<h4>\u663e\u5b58\u98ce\u66b4\u9632\u5fa1&#xff1a;DPR \u7684\u514b\u5236\u4e0e\u5206\u5c42\u6e32\u67d3<\/h4>\n<p>\u5728 3x DPR \u7684\u624b\u673a\u5c4f\u5e55\u6216 Retina 5K iMac \u4e0a&#xff0c;\u76f2\u76ee\u4e58\u4ee5 DPR \u4f1a\u4f7f\u4e00\u5757 1920\u00d71080 \u7684\u5168\u5c4f Canvas \u77ac\u95f4\u81a8\u80c0\u5230 5760\u00d73240 \u50cf\u7d20&#xff0c;\u5355\u5e27\u4f4d\u56fe\u663e\u5b58\u5360\u7528\u7a81\u7834 75MB&#xff08;RGBA \u56db\u901a\u9053&#xff09;&#xff0c;\u5e26\u6765\u4e25\u91cd\u7684\u5185\u5b58\u8b66\u544a\u4e0e\u6e32\u67d3\u53d1\u70ed\u3002<\/p>\n<p>\u751f\u4ea7\u73af\u5883\u4e0b\u7684\u4e09\u9879\u9632\u5fa1\u51c6\u5219&#xff1a;<\/p>\n<li>DPR \u4e0a\u9650\u94b3\u5236&#xff1a;\u5728\u7edd\u5927\u591a\u6570\u4e1a\u52a1\u573a\u666f\u4e2d&#xff0c;\u4eba\u773c\u5728 dpr &#061; 2 \u65f6\u5df2\u6781\u96be\u5bdf\u89c9\u70b9\u9635\u9897\u7c92\u611f\u3002\u56e0\u6b64\u5f3a\u5236\u5c06 maxDpr \u9501\u5b9a\u5728 2&#xff0c;\u662f\u5bf9\u79fb\u52a8\u7aef\u6781\u4e3a\u53cb\u5584\u7684\u5de5\u7a0b\u6298\u4e2d\u3002<\/li>\n<li>\u52a8\u9759\u5206\u5c42&#xff08;Layer Splitting&#xff09;&#xff1a;\u5c06\u9759\u6001\u80cc\u666f\u7f51\u683c\u3001\u5750\u6807\u8f74\u653e\u5728\u72ec\u7acb\u7684\u5e95\u5c42 Canvas&#xff08;DPR \u8bbe\u7f6e\u4e3a 2 \u5e76\u4ec5\u6e32\u67d3\u4e00\u6b21&#xff09;&#xff0c;\u800c\u9ad8\u9891\u66f4\u65b0\u7684\u6e38\u6807\u7c92\u5b50\u4e0e\u60ac\u6d6e\u63d0\u793a\u653e\u5728\u9876\u5c42 Canvas\u3002<\/li>\n<li>\u56fe\u50cf\u5e73\u6ed1\u5f00\u5173\u63a7\u5236&#xff1a;\u5728\u50cf\u7d20\u827a\u672f\u6216\u67d0\u4e9b\u9700\u8981\u9510\u5229\u8fb9\u754c\u7684\u79d1\u5b66\u56fe\u8868\u4e2d&#xff0c;\u9002\u65f6\u663e\u5f0f\u5173\u95ed ctx.imageSmoothingEnabled &#061; false&#xff0c;\u9632\u6b62\u7f29\u653e\u65f6\u7684\u4f2a\u5e73\u6ed1\u9020\u6210\u7684\u7ec6\u8282\u4e22\u5931\u3002<\/li>\n<p>\u7528\u7cbe\u51c6\u7684\u50cf\u7d20\u6620\u5c04\u9a7e\u9a6d\u5149\u6805&#xff0c;\u65b9\u80fd\u4f7f\u58a8\u8272\u7ebf\u6761\u5728\u4efb\u4f55\u5206\u8fa8\u7387\u7684\u5c4f\u5e55\u4e0a&#xff0c;\u90fd\u5982\u91d1\u77f3\u523b\u5370\u822c\u660e\u6670\u9052\u52b2\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Canvas \u6e32\u67d3\u9ad8 DPI \u5c4f\u5e55\u4e0b\u7684\u6a21\u7cca\u6cbb\u7406\u4e0e\u4f18\u5316\u5728\u6570\u636e\u53ef\u89c6\u5316\u548c\u56fe\u8868\u7ed8\u5236\u4e2d&#xff0c;\u524d\u7aef\u5de5\u7a0b\u5e08\u6700\u5e38\u6536\u5230\u7684\u89c6\u89c9 Bug \u53cd\u9988\u4e4b\u4e00\u5c31\u662f&#xff1a;\u201c\u5728 MacBook Retina \u5c4f\u6216 4K \u9ad8\u5237\u5c4f\u4e0a&#xff0c;Canvas \u7ed8\u5236\u7684\u6298\u7ebf\u3001\u6587\u5b57\u548c\u5706\u70b9\u8fb9\u7f18\u53d1\u865a&#xff0c;\u5b9b\u5982\u88ab\u8499\u4e0a\u4e86\u4e00\u5c42\u6bdb\u73bb\u7483\u201d\u3002\u800c\u5982\u679c\u4ec5\u4ec5\u7167\u672c\u5ba3\u79d1\u5730\u5c06 Canvas \u5c3a\u5bf8\u65e0\u8111\u653e\u5927 3 \u500d\u6216 4 \u500d&#xff0c;\u53c8\u6781\u6613\u5f15\u53d1\u79fb\u52a8\u7aef\u6216\u4f4e\u914d\u8bbe\u5907\u7684\u663e\u5b58\u8d85\u9650&#xff08;OOM&#xff09;\u3001\u6389\u5e27\u4ee5\u53ca<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[9627,66,50,87,51],"topic":[],"class_list":["post-106556","post","type-post","status-publish","format-standard","hentry","category-server","tag-webgl","tag-ai","tag-50","tag-87","tag-51"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Canvas \u6e32\u67d3\u9ad8 DPI \u5c4f\u5e55\u4e0b\u7684\u6a21\u7cca\u6cbb\u7406\u4e0e\u4f18\u5316 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/106556.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Canvas \u6e32\u67d3\u9ad8 DPI \u5c4f\u5e55\u4e0b\u7684\u6a21\u7cca\u6cbb\u7406\u4e0e\u4f18\u5316 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"Canvas \u6e32\u67d3\u9ad8 DPI \u5c4f\u5e55\u4e0b\u7684\u6a21\u7cca\u6cbb\u7406\u4e0e\u4f18\u5316\u5728\u6570\u636e\u53ef\u89c6\u5316\u548c\u56fe\u8868\u7ed8\u5236\u4e2d&#xff0c;\u524d\u7aef\u5de5\u7a0b\u5e08\u6700\u5e38\u6536\u5230\u7684\u89c6\u89c9 Bug \u53cd\u9988\u4e4b\u4e00\u5c31\u662f&#xff1a;\u201c\u5728 MacBook Retina \u5c4f\u6216 4K \u9ad8\u5237\u5c4f\u4e0a&#xff0c;Canvas \u7ed8\u5236\u7684\u6298\u7ebf\u3001\u6587\u5b57\u548c\u5706\u70b9\u8fb9\u7f18\u53d1\u865a&#xff0c;\u5b9b\u5982\u88ab\u8499\u4e0a\u4e86\u4e00\u5c42\u6bdb\u73bb\u7483\u201d\u3002\u800c\u5982\u679c\u4ec5\u4ec5\u7167\u672c\u5ba3\u79d1\u5730\u5c06 Canvas \u5c3a\u5bf8\u65e0\u8111\u653e\u5927 3 \u500d\u6216 4 \u500d&#xff0c;\u53c8\u6781\u6613\u5f15\u53d1\u79fb\u52a8\u7aef\u6216\u4f4e\u914d\u8bbe\u5907\u7684\u663e\u5b58\u8d85\u9650&#xff08;OOM&#xff09;\u3001\u6389\u5e27\u4ee5\u53ca\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/106556.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-17T08:32:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260917083234-6aaba5a28b8b6.webp\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/106556.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/106556.html\",\"name\":\"Canvas \u6e32\u67d3\u9ad8 DPI \u5c4f\u5e55\u4e0b\u7684\u6a21\u7cca\u6cbb\u7406\u4e0e\u4f18\u5316 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-17T08:32:36+00:00\",\"dateModified\":\"2026-09-17T08:32:36+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/106556.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/106556.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/106556.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Canvas \u6e32\u67d3\u9ad8 DPI \u5c4f\u5e55\u4e0b\u7684\u6a21\u7cca\u6cbb\u7406\u4e0e\u4f18\u5316\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Canvas \u6e32\u67d3\u9ad8 DPI \u5c4f\u5e55\u4e0b\u7684\u6a21\u7cca\u6cbb\u7406\u4e0e\u4f18\u5316 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/106556.html","og_locale":"zh_CN","og_type":"article","og_title":"Canvas \u6e32\u67d3\u9ad8 DPI \u5c4f\u5e55\u4e0b\u7684\u6a21\u7cca\u6cbb\u7406\u4e0e\u4f18\u5316 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"Canvas \u6e32\u67d3\u9ad8 DPI \u5c4f\u5e55\u4e0b\u7684\u6a21\u7cca\u6cbb\u7406\u4e0e\u4f18\u5316\u5728\u6570\u636e\u53ef\u89c6\u5316\u548c\u56fe\u8868\u7ed8\u5236\u4e2d&#xff0c;\u524d\u7aef\u5de5\u7a0b\u5e08\u6700\u5e38\u6536\u5230\u7684\u89c6\u89c9 Bug \u53cd\u9988\u4e4b\u4e00\u5c31\u662f&#xff1a;\u201c\u5728 MacBook Retina \u5c4f\u6216 4K \u9ad8\u5237\u5c4f\u4e0a&#xff0c;Canvas \u7ed8\u5236\u7684\u6298\u7ebf\u3001\u6587\u5b57\u548c\u5706\u70b9\u8fb9\u7f18\u53d1\u865a&#xff0c;\u5b9b\u5982\u88ab\u8499\u4e0a\u4e86\u4e00\u5c42\u6bdb\u73bb\u7483\u201d\u3002\u800c\u5982\u679c\u4ec5\u4ec5\u7167\u672c\u5ba3\u79d1\u5730\u5c06 Canvas \u5c3a\u5bf8\u65e0\u8111\u653e\u5927 3 \u500d\u6216 4 \u500d&#xff0c;\u53c8\u6781\u6613\u5f15\u53d1\u79fb\u52a8\u7aef\u6216\u4f4e\u914d\u8bbe\u5907\u7684\u663e\u5b58\u8d85\u9650&#xff08;OOM&#xff09;\u3001\u6389\u5e27\u4ee5\u53ca","og_url":"https:\/\/www.wsisp.com\/helps\/106556.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-17T08:32:36+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260917083234-6aaba5a28b8b6.webp"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/106556.html","url":"https:\/\/www.wsisp.com\/helps\/106556.html","name":"Canvas \u6e32\u67d3\u9ad8 DPI \u5c4f\u5e55\u4e0b\u7684\u6a21\u7cca\u6cbb\u7406\u4e0e\u4f18\u5316 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-17T08:32:36+00:00","dateModified":"2026-09-17T08:32:36+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/106556.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/106556.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/106556.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Canvas \u6e32\u67d3\u9ad8 DPI \u5c4f\u5e55\u4e0b\u7684\u6a21\u7cca\u6cbb\u7406\u4e0e\u4f18\u5316"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/106556","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=106556"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/106556\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=106556"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=106556"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=106556"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=106556"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}