<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>在canvas中绘制和拖动</title>
<style>
canvas {
background-color: #ccc;
}
</style>
</head>
<body>
<input type="color" />
<canvas></canvas>
<script>
const colorPicker = document.querySelector('input');
const cvs = document.querySelector('canvas');
const ctx = cvs.getContext('2d');
function init
【前端】【canvas】在canvas中绘制和拖动
最新推荐文章于 2024-06-27 15:04:50 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)