简体   繁体   English

HTML5 Canvas的“绘制”方法?

[英]'Paint' method for HTML5 Canvas?

Is there a way of preventing anything drawn to the canvas to be seen until a certain point? 有没有一种方法可以防止在特定位置之前看不到画布上绘制的任何内容? I'd like to be able to draw a number of objects at once, then draw over them with another object and a different composite method, on a loop. 我希望能够一次绘制多个对象,然后在循环上使用另一个对象和不同的复合方法在它们上面绘制。

Because the first lot of painting takes so long, the result will only be seen for a fraction of a second before it loops. 由于第一批绘画需要很长时间,因此在循环之前,只有一秒钟的时间才能看到结果。

正常的方法是将这些对象渲染到屏幕外的Canvas ,然后使用context.drawImage()将其复制到屏幕上。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM