第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

為什么運(yùn)行出來(lái)是黑色的,都找了一周的問(wèn)題

<!DOCTYPE?html>
<html>
<head>
????<title></title>
????<meta?charset="utf-8">
????<style?type="text/css"></style>
</head>
<body>
????<canvas?id="canvas"style="border:1px?solid?#aaa;display:block;margin:50px?auto;"></canvas>
????<script>
????????window.onload=function(){
????????????var?canvas=document.getElementById("canvas");
????????????canvas.height=768;
????????????canvas.width=1024;
????????????var?context=canvas.getContext("2d");

????????????drawRect(context,100,100,400,400,20,"green","red");

????????}

????????function?drawRect(cxt,x,y,width,height,borderWidth,borerColor,fillColor){
????????????cxt.beginPath();
????????????cxt.moveTo(x,y);
????????????cxt.lineTo(x?+?width,y);
????????????cxt.lineTo(x?+?width,y?+?height);
????????????cxt.lineTo(x,y?+?height);
????????????cxt.lineTo(x,y);
????????????cxt.closePath();
????????????
????????????cxt.lineWidth="borderWidth";
????????????cxt.fillStyle="fillColor";
????????????cxt.strokeStyle="borerColor";

????????????
????????????cxt.fill();
????????????cxt.stroke();
????????}
????????
????</script>
</body>
</html>


http://img1.sycdn.imooc.com//5610bd630001d61415560984.jpg

正在回答

3 回答

cxt.fillStyle=fillColor;
cxt.strokeStyle=borerColor;

fillColor和borerColor是變量,不能用引號(hào)。

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

逆向的藝術(shù) 提問(wèn)者

真是太感謝了!我這眼睛怎么就發(fā)現(xiàn)不了呢!
2015-10-04 回復(fù) 有任何疑惑可以回復(fù)我~
#2

Y_du 回復(fù) 逆向的藝術(shù) 提問(wèn)者

對(duì)代碼不熟悉,多寫(xiě)寫(xiě)就好了
2015-10-04 回復(fù) 有任何疑惑可以回復(fù)我~
cxt.lineWidth=borderWidth;

這個(gè)也是相同的問(wèn)題

0 回復(fù) 有任何疑惑可以回復(fù)我~

真的是完全檢測(cè)不出bug,好憂傷

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

為什么運(yùn)行出來(lái)是黑色的,都找了一周的問(wèn)題

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)