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

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

      1. <tfoot id='rhwUm'></tfoot>
      2. <legend id='rhwUm'><style id='rhwUm'><dir id='rhwUm'><q id='rhwUm'></q></dir></style></legend>
        • <bdo id='rhwUm'></bdo><ul id='rhwUm'></ul>
      3. 如何在 HTML5 画布上画一个模糊的圆圈?

        时间:2023-09-07
          <tbody id='2ItwC'></tbody>

        <small id='2ItwC'></small><noframes id='2ItwC'>

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

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

                • <bdo id='2ItwC'></bdo><ul id='2ItwC'></ul>
                  本文介绍了如何在 HTML5 画布上画一个模糊的圆圈?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我可以在 HTML5 画布上绘制一个简单的圆圈,但我想在它周围添加一些模糊.

                  我发现的是

                  I'm able to draw a simple circle on HTML5 canvas, but I'd like to add some blur around it.

                  What I found was this website which explains the shadowBlur property which can come in handy here.

                  However, I cannot manage to make the circle itself blurry. What the shadowBlur property basically does is painting some blur effect after the regular circle has been drawn. What I've tried so far I've put on jsFiddle.

                  As can be seen, it's a solid filled circle with some blur effect around it - the two parts do not blend into each other at all. What I actually would like to achieve is that the circle itself is fully blurred like this:

                  Is there any way to draw a blurred circle like this, i.e. that the circle itself also has a blur effect?

                  解决方案

                  I'd strongly suggest against blur algorithms unless you are blurring some already-existing drawing that is complex.

                  For your case, just draw a rect with a radial gradient.

                    var radgrad = ctx.createRadialGradient(60,60,0,60,60,60);
                    radgrad.addColorStop(0, 'rgba(255,0,0,1)');
                    radgrad.addColorStop(0.8, 'rgba(228,0,0,.9)');
                    radgrad.addColorStop(1, 'rgba(228,0,0,0)');
                  
                    // draw shape
                    ctx.fillStyle = radgrad;
                    ctx.fillRect(0,0,150,150);
                  

                  Example:

                  http://jsfiddle.net/r8Kqy/48/

                  这篇关于如何在 HTML5 画布上画一个模糊的圆圈?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:在 CSS 中以圆形垂直和水平居中文本(如 iphone 通知 下一篇:如何限制圆区域内的运动

                  相关文章

                  最新文章

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

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

                  <tfoot id='MNRWF'></tfoot>

                      <bdo id='MNRWF'></bdo><ul id='MNRWF'></ul>
                    1. <small id='MNRWF'></small><noframes id='MNRWF'>