Home  >  Article  >  Web Front-end  >  canvas searchlight effect

canvas searchlight effect

高洛峰
高洛峰Original
2017-02-09 17:11:351733browse

The clip() method in canvas is used to cut any shape and size from the original canvas. Once an area is clipped, all subsequent drawings will be limited to the clipped area (other areas on the canvas cannot be accessed)

You can also use save before using the clip() method () method to save the current canvas area and restore it at any time in the future through the restore() method

Next, use the clip() method to achieve a searchlight effect

当前浏览器不支持canvas,请更换浏览器后再试

For more canvas searchlight effects and related articles, please pay attention to the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:css related tipsNext article:css related tips