HTML5 畫布canvas

來源:互聯網
上載者:User

標籤:

SVG的<defs> <symbols> 元素用於預定義一個元素使其能夠在SVG映像中重複使用 

<svg xmlns="http://www.w3.org/2000/svg" width="500" height="100">

    <symbol id="shape2">        <circle cx="25" cy="25" r="25" style="fill:#bf55ec;"/>    </symbol>     <use xlink:href="#shape2" x="50" y="25" /></svg> 也可用url的方式引用
 <defs>        <linearGradient id="linearGradient">            <stop offset="0%" stop-color="#f00" />            <stop offset="100" stop-color="#f60" />        </linearGradient>    </defs>    // 應用線性漸層    <rect x="10" y="10" width="300" height="100" stroke="orange" stroke-width="5" fill="url(#linearGradient)" />
或
<defs><clipPath id="highcharts-1"><rect x="0" y="0" width="814" height="247"></rect></clipPath></defs>
<g class="highcharts-series highcharts-tracker" visibility="visible" zIndex="0.1" transform="translate(0,0) scale(1 1)" style="" clip-path="url(#highcharts-1)"></g>
transforms屬性中的  translate:圖形位置平移  scale:圖形縮放 都是距離繪圖區域左上方的位置確定
如:
<defs><clipPath id="highcharts-1"><rect x="0" y="0" width="814" height="247"></rect></clipPath></defs>
<g class="highcharts-series highcharts-tracker" visibility="visible" zIndex="0.1" transform="translate(70,80) scale(1 1)" style="" clip-path="url(#highcharts-1)"></g>
如果scale Y軸縮小為原來的0.6倍scale(1 0.6)那麼產生的圖形即為 圖形高度247*(1-0.6)+原Y軸值80 = 179.2
<g class="highcharts-series highcharts-tracker" visibility="visible" zIndex="0.1" transform="translate(70,179.2) scale(1 0.6)" style="" clip-path="url(#highcharts-1)"></g>

即:translate(70,80) scale(1 1) =======》》》translate(70,179.2) scale(1 0.6)

text-anchor屬性可以用作對齊使用
transform="translate(0,0) rotate(旋轉角度,旋轉後位置X,位置Y)"



HTML5 畫布canvas

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.