动态改变canvas宽高时 draw(true)没有效果
发布于 6 年前 作者 mingpeng 3154 次浏览 来自 问答



<script>const%25252520ctx%25252520%2525253D%25252520wx.createCanvasContext(%25252526%2525252339%2525253Bcanvas%25252526%2525252339%2525253B)%2525250A%25252520%25252526nbsp%2525253B%25252520%25252526nbsp%2525253B%25252520%25252526nbsp%2525253Bthis.canvasSize%25252520%2525253D%25252520%2525257Bwidth%2525253A%25252520400%2525252C%25252520height%2525253A%25252520500%2525257D%2525250A%25252520%25252526nbsp%2525253B%25252520%25252526nbsp%2525253B%25252520%25252526nbsp%2525253Bctx.setFillStyle(%25252526%2525252339%2525253Bred%25252526%2525252339%2525253B)%2525250A%25252520%25252526nbsp%2525253B%25252520%25252526nbsp%2525253B%25252520%25252526nbsp%2525253Bctx.fillRect(10%2525252C%2525252010%2525252C%25252520150%2525252C%25252520100)%2525250A%25252520%25252526nbsp%2525253B%25252520%25252526nbsp%2525253B%25252520%25252526nbsp%2525253Bctx.draw()%2525250A%25252520%25252526nbsp%2525253B%25252520%25252526nbsp%2525253B%25252520%25252526nbsp%2525253Bctx.fillRect(50%2525252C%2525252050%2525252C%25252520150%2525252C%25252520100)%2525250A%25252520%25252526nbsp%2525253B%25252520%25252526nbsp%2525253B%25252520%25252526nbsp%2525253Bctx.draw(true)</script>

回到顶部