<tfoot id='0hTqf'></tfoot>

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

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

    1. <legend id='0hTqf'><style id='0hTqf'><dir id='0hTqf'><q id='0hTqf'></q></dir></style></legend>

        <bdo id='0hTqf'></bdo><ul id='0hTqf'></ul>
      1. 如何清除画布以进行重绘

        时间:2023-06-21
        • <bdo id='c5LOv'></bdo><ul id='c5LOv'></ul>

          1. <legend id='c5LOv'><style id='c5LOv'><dir id='c5LOv'><q id='c5LOv'></q></dir></style></legend>
                <tbody id='c5LOv'></tbody>
              1. <i id='c5LOv'><tr id='c5LOv'><dt id='c5LOv'><q id='c5LOv'><span id='c5LOv'><b id='c5LOv'><form id='c5LOv'><ins id='c5LOv'></ins><ul id='c5LOv'></ul><sub id='c5LOv'></sub></form><legend id='c5LOv'></legend><bdo id='c5LOv'><pre id='c5LOv'><center id='c5LOv'></center></pre></bdo></b><th id='c5LOv'></th></span></q></dt></tr></i><div id='c5LOv'><tfoot id='c5LOv'></tfoot><dl id='c5LOv'><fieldset id='c5LOv'></fieldset></dl></div>
              2. <small id='c5LOv'></small><noframes id='c5LOv'>

                <tfoot id='c5LOv'></tfoot>

                  本文介绍了如何清除画布以进行重绘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在尝试了合成操作并在画布上绘制图像之后,我现在尝试删除图像并进行合成.我该怎么做?

                  After experimenting with composite operations and drawing images on the canvas I'm now trying to remove images and compositing. How do I do this?

                  我需要清除画布以重绘其他图像;这可能会持续一段时间,所以我不认为每次都绘制一个新矩形是最有效的选择.

                  I need to clear the canvas for redrawing other images; this can go on for a while so I don't think drawing a new rectangle every time will be the most efficient option.

                  推荐答案

                  鉴于 canvas 是一个画布元素或 OffscreenCanvas 对象,

                  Given that canvas is a canvas element or an OffscreenCanvas object,

                  const context = canvas.getContext('2d');
                  
                  context.clearRect(0, 0, canvas.width, canvas.height);
                  

                  这篇关于如何清除画布以进行重绘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:为什么 JS 模态消息框会在 setTimeout() 上暂停倒计时? 下一篇:受污染的画布不得出口

                  相关文章

                  <tfoot id='zco7e'></tfoot>

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

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

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

                  <legend id='zco7e'><style id='zco7e'><dir id='zco7e'><q id='zco7e'></q></dir></style></legend>