HTML5 Canvas Transformation State Stack Tutorial

To save and restore different transformation states with the HTML5 Canvas, we can use the save() and restore() methods of the canvas context.

In this tutorial, we'll save the transformation state by pushing the state onto the state stack immediately before each transformation.  We'll draw a blue rectangle, restore and pop off the last transformation state and draw a red rectangle, restore and pop off the last transformation state and draw a yellow rectangle, and then finally restore and pop off the final transformation state and draw a green rectangle.

邮箱:
密码:

微信扫描二维码捐赠

当前实例由www.100sucai.com整理,
仅作学习参考。感谢大家对本站的支持
web前端交流群:Css Js 网站美工
Oval