Explorar el Código

画布测试页面

不会爬树的猴 hace 2 años
padre
commit
3bf864ca31
Se han modificado 1 ficheros con 19 adiciones y 0 borrados
  1. 19 0
      src/demo.html

+ 19 - 0
src/demo.html

@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<meta charset="utf-8">
+		<title></title>
+	</head>
+	<body>
+		<canvas width="1024px" height="256px" id="canvas" style="background-color: antiquewhite;"></canvas>
+	</body>
+</html>
+<script>
+	let canvasObj = document.getElementById('canvas');
+	let context = canvasObj.getContext('2d');
+	context.fillStyle = 'rgba(255,0,0,0.9)';
+	context.font = 'bold 240px 微软雅黑';
+	context.textAlign = 'left';
+	context.textBaseline = 'bottom';
+	context.fillText('我是一个立', 12, 250, 1000);
+</script>