【单选题】绘制字体大小为 40px ,字体为“ Arial ”,颜色为“ rgb a( 255,255,0,0.8) ”,文字内容为“ Happy 2017 ”的填充文本,请问以下哪项代码是正确的?
A.
txt=" Happy 2017 "; ctx.fontSize = "40px"; ctx.fontName = "Arial"; ctx.fontColor= " rgb a( 255,255,0,0.8 ) "; ctx.fillText(txt,0,0);
B.
txt=" Happy 2017 "; ctx.font = "40px Arial"; ctx.fillStyle = " rgb a( 255,255,0,0.8 ) "; ctx.fillText(txt,0,0);
C.
txt=" Happy 2017 "; ctx.fontSize = "40px"; ctx.fontName = "Arial"; ctx.fillColor= " rgb a( 255,255,0,0.8 ) "; ctx.fillText(txt,0,0);
D.
txt=" Happy 2017 "; ctx.font = "40px Arial"; ctx.strokeColor= " rgb a( 255,255,0,0.8 ) "; ctx.strokeText(txt,0,0);