簡體   English   中英

如何用 SVG 替換 Canvas 元素?

[英]How can I replace Canvas element with SVG?

我目前正在嘗試為畫布元素提供具有圓形邊框的形狀。 根據我的經驗, Canvas類中不存在CornerRadius參數/方法?

我想使用 SVG 元素而不是這個白色畫布元素。

<Canvas Background="White" Width="250" Height="200">
    <TextBlock Text="LOW" Foreground="Black" FontSize="30" TextAlignment="Center" Margin="10"></TextBlock>
    <TextBlock FontSize="40" Padding="0, 0, 300, 0" Margin="74" Text="11" Foreground="Black"></TextBlock>
</Canvas>

這個畫布元素到 SVG

問題解決了

<Border CornerRadius="10" Background="White" Height="200" Width="200">
                <Canvas Background="White"  Width="250" Height="200" HorizontalAlignment="Left" >
                    <TextBlock Text="LOW" Foreground="Black" FontSize="30" TextAlignment="Center" Margin="10"></TextBlock>
                    <TextBlock FontSize="40" Padding="0, 0, 300, 0" Margin="74" Text="11" Foreground="Black">
                    </TextBlock>
                </Canvas>
</Border>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM