UNPKG

screen-shot-forvue

Version:

web端自定义截屏插件(Vue3版),一个基于vue-web-screen-shot二开的插件

15 lines (14 loc) 409 B
/** * 绘制蒙层 * @param context 需要进行绘制canvas */ export function drawMasking(context: CanvasRenderingContext2D) { // 清除画布 context.clearRect(0, 0, window.screen.width, window.screen.height); // 绘制蒙层 context.save(); context.fillStyle = "rgba(0, 0, 0, .6)"; context.fillRect(0, 0, window.screen.width, window.screen.height); // 绘制结束 context.restore(); }