<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>quadraticCurveTo</title> </head> <body> <canvas id=‘myCanvas‘ width=‘200‘ height=‘100‘> your browser does not support canvas </canvas> <script type="text/javascript"> var c = document.getElementById(‘myCanvas‘); var cxt = c.getContext(‘2d‘); cxt.beginPath(); cxt.moveTo(20, 100); cxt.quadraticCurveTo(60, 50, 100, 100); cxt.lineTo(60, 50); cxt.lineTo(20, 100); cxt.stroke(); </script> </body> </html>
时间: 2024-10-06 21:04:04