开发者

'Paint' method for HTML5 Canvas?

开发者 https://www.devze.com 2023-03-25 00:51 出处:网络
Is there a way of preventing anything drawn to the canvas to be see开发者_开发知识库n until a certain point? I\'d like to be able to draw a number of objects at once, then draw over them with another

Is there a way of preventing anything drawn to the canvas to be see开发者_开发知识库n 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.


The normal method would be to render those objects into an off-screen Canvas, and then use context.drawImage() to copy it onto the on-screen one.

0

精彩评论

暂无评论...
验证码 换一张
取 消