简体   繁体   中英

How can I replace Canvas element with SVG?

I'm currently trying to give a canvas element a shape that has a round border. As I know from my experience, the CornerRadius parameter/method does not exist in the Canvas class?

I want to use an SVG element instead of this white canvas element.

<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

Problem Solved

<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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM