<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                [TOC] ## 顏色 1. `fillStyle = color`設置圖形的填充顏色 2. `strokeStyle = color`設置圖形輪廓的顏色 顏色格式為 `rgb(255,255,255)` 或 `rgba(255,255,255,0.5)` ## Transparency(透明度) `globalAlpha = transparencyValue ` 這個屬性影響到 canvas 里所有圖形的透明度,0.0-1.0 ,0為完全不透明 ## line style 線寬 ``` lineWidth=int_val (>0) ``` ## 線條末端樣式 ``` lineCap = type butt 線段末端以方形結束 round 線段末端以圓形結束 square 線段末端以方形結束,但是增加了一個寬度和線段相同,高度是線段厚度一半的矩形區域 ``` 實例 ``` var draw=()=>{ let canvas = document.querySelector("#tutorial"); if(!canvas.getContext)return; /** * @type CanvasRenderingContext2D */ let ctx = canvas.getContext("2d"); ctx.beginPath() ctx.moveTo(10,10) ctx.lineTo(10,200) ctx.lineCap="square"//butt,round,square ctx.lineWidth=20 ctx.stroke() } ``` 分別為 "butt","round","square" ![](https://www.runoob.com/wp-content/uploads/2018/12/3380216230-5b74dd8e97e85_articlex.png) ## 線條與線條間接合處的樣式 ``` lineJoin = type round 通過填充一個額外的,圓心在相連部分末端的扇形,繪制拐角的形狀。 圓角的半徑是線段的寬度。 bevel 在相連部分的末端填充一個額外的以三角形為底的區域, 每個部分都有各自獨立的矩形拐角。 miter(默認) 通過延伸相連部分的外邊緣,使其相交于一點,形成一個額外的菱形區域。 ``` ![](https://www.runoob.com/wp-content/uploads/2018/12/1584506777-5b74dd8e82768_articlex.png) ## 虛線 setLineDash 方法接受一個數組,來指定線段與間隙的交替; lineDashOffset屬性設置起始偏移量。 實例 ``` var draw=()=>{ let canvas = document.querySelector("#tutorial"); if(!canvas.getContext)return; /** * @type CanvasRenderingContext2D */ let ctx = canvas.getContext("2d"); ctx.setLineDash([20,5]); ctx.lineDashOffset=0 ctx.strokeRect(50,50,200,200) } ``` ![](https://img.kancloud.cn/d3/96/d39684fad5f9727dab7a93c6e43a09a5_251x257.png)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看