【Javascript网页设计】在线图片画板案例
代码如下:
 <!DOCTYPE html>
 <html lang="zh">
 <head>
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <title>在线画板</title>
     <style>
         body {
 
             text-align: center;
             font-family: Arial, sans-serif;
             margin: 20px;
         }
         .toolbar {
 
             margin-bottom: 10px;
         }
         canvas {
 
             border: 2px solid #000;
             cursor: crosshair;
         }
         button {
 
             margin: 5px;
             padding: 8px 15px;
             border: none;
             background-color: #007bff;
             color: white;
             cursor: pointer;
             border-radius: 5px;
         }
         button:hover {
 
             background-color: #0056b3;
         }
     </style>
 </head>
 <body>
     <h2>🎨 在线画板</h2>
     
     <div class="toolbar">
         <label>颜色:
             <input type="color" id="colorPicker" value="#000000">
         </label>
         <label>画笔大小:
             <input type="range" id="sizePicker" min="1" max="10" val
