目前共有2篇帖子。 字体大小:较小 - 100% (默认)▼  内容转换:港澳繁體▼
 
点击 回复
220 1
Vista的IE9支持canvas畫布
一派掌门 二十级
1楼 发表于:2024-5-23 20:40
一派掌门 二十级
2楼 发表于:2024-5-23 20:40
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Test canvas</title>
<script>
function drawPicture() {
    var canvas = document.querySelector("#myCanvas");
    var ctx = canvas.getContext("2d");
    ctx.fillStyle = "#FFCCDD";
    ctx.fillRect(0, 0, 200, 100);

    ctx.beginPath();
    ctx.arc(95, 50, 40, 0, 2 * Math.PI);
    ctx.stroke();

    ctx.font = "30px Arial";
    ctx.fillStyle = "cyan";
    ctx.fillText("Hello World", 10, 50);
}
</script>
</head>

<body onload="drawPicture()">
<canvas id="myCanvas" width="200" height="100" style="border: 1px solid black"></canvas>
</body>
</html>
 

回复帖子

内容:
用户名: 您目前是匿名发表
验证码:
(快捷键:Ctrl+Enter)
 

本帖信息

点击数:220 回复数:1
评论数: ?
作者:巨大八爪鱼
最后回复:巨大八爪鱼
最后回复时间:2024-5-23 20:40
 
©2010-2025 Purasbar Ver2.0
除非另有声明,本站采用知识共享署名-相同方式共享 3.0 Unported许可协议进行许可。