2022-03-19 1099
rect() 方法创建矩形。 提示:请使用 stroke<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>小白教程</title> </head> <body> <canvas id="myCanvas" width="300" height="150" style="border:1px solid #d3d3d3;"> 您的浏览器不支持 HTML5 canvas 标签。 </canvas> <script> var c=document.getElementById("myCanvas"); var ctx=c.getContext("2d"); // 红色矩形 ctx.beginPath(); ctx.lineWidth="6"; ctx.strokeStyle="red"; ctx.rect(5,5,260,139); ctx.stroke(); // 绿色矩形 ctx.beginPath(); ctx.lineWidth="4"; ctx.strokeStyle="green"; ctx.rect(30,30,100,50); ctx.stroke(); // 蓝色矩形 ctx.beginPath(); ctx.lineWidth="10"; ctx.strokeStyle="blue"; ctx.rect(90,50,100,80); ctx.stroke(); </script> </body> </html>() 或 fill() 方法在画布上实际地绘制矩形。
rect() 方法创建矩形。
提示:请使用 stroke() 或 fill() 方法在画布上实际地绘制矩形。
原文链接:https://77isp.com/post/757.html
=========================================
https://77isp.com/ 为 “云服务器技术网” 唯一官方服务平台,请勿相信其他任何渠道。
数据库技术 2022-03-28
网站技术 2022-11-26
网站技术 2023-01-07
网站技术 2022-11-17
Windows相关 2022-02-23
网站技术 2023-01-14
Windows相关 2022-02-16
Windows相关 2022-02-16
Linux相关 2022-02-27
数据库技术 2022-02-20
抠敌 2023年10月23日
嚼餐 2023年10月23日
男忌 2023年10月22日
瓮仆 2023年10月22日
簿偌 2023年10月22日
扫码二维码
获取最新动态