「Javascript/canvas」の版間の差分
提供: 初心者エンジニアの簡易メモ
(ページの作成:「==helloworld== <<nowiki />html> <<nowiki />head> <<nowiki />script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></scrip...」) |
(相違点なし)
|
2015年5月20日 (水) 03:11時点における最新版
helloworld
<html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script> <script> $(function() { var canvas = document.getElementById('sample'); var context = canvas.getContext('2d'); context.fillStyle = 'rgb(255,00,00)'; // 塗りつぶし context.fillRect(20,40,50,100); // 四角 }); </script> </head> <body> <canvas width="400" height="300" id="sample"></canvas> </body> </html>