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
For more canvas searchlight effects and related articles, please pay attention to the PHP Chinese website!