wulin.com(www.vevb.com)の記事紹介:ストロークカラーhtml5キャンバステキストを設定するには、strokestyleキャンバスの背景とstroketext()メソッドを使用できます。
ストロークカラーHTML5キャンバステキストを設定するには、Strokestyleキャンバスとstroketext()メソッドの背景を使用できます。
次の例を見てみましょう。
<!doctype html>
<html>
<head>
<title> html5_canvas_text_stroke </title>
<style>
ボディ{マージン:0px;パディング:0px;}
#mycanvas {border:1px solid#9c9898;マージン:0オート;マージントップ:200px;マージン左:100px;}
</style>
<スクリプト>
window.onload = function(){
var canvas = document.getElementbyid(mycanvas);
var context = canvas.getContext(2d);
var x = 80;
var y = 110;
context.font = 60pt calibri;
Context.LineWidth = 3;
Context.Strokestyle = blue; //ストロークカラー
Context.StrokeText(Hello World!、X、Y);
};
</script>
</head>
<body>
<キャンバスID = mycanvas width = 578 heigh = 200>
</canvas>
</body>
</html>