Answer the question
In order to leave comments, you need to log in
How to insert a vector image into a WPF window?
It seems that you need to convert svg to xaml, I did it in inskape, but I don’t know what to do next. Can you suggest the simplest and most understandable way to insert a vector image on a form?
Answer the question
In order to leave comments, you need to log in
The image can be enlarged (click or open in a new tab). XAML code is formatted with the XamlStyler extension.
<Window
x:Class="WpfVectorImage.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:icons="clr-namespace:WpfVectorImage.Icons"
xmlns:local="clr-namespace:WpfVectorImage"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="MainWindow"
Width="800"
Height="450"
mc:Ignorable="d">
<Grid>
<icons:DumbbellIcon />
</Grid>
</Window>
<UserControl
x:Class="WpfVectorImage.Icons.DumbbellIcon"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:WpfVectorImage.Icons"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<Viewbox Stretch="Uniform">
<Canvas
Name="Layer_1"
Width="512"
Height="512">
<Canvas.RenderTransform>
<TranslateTransform X="0" Y="0" />
</Canvas.RenderTransform>
<Canvas.Resources />
<Canvas Name="g79">
<Canvas Name="g73">
</Canvas>
</Canvas>
</Canvas>
</Viewbox>
</UserControl>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question