Replies: 4 comments 17 replies
-
@jgrossrieder Please, can you draw an picture/illustration of how you want the final result to look like? Just render each, copy the screenshots and position with any drawing application like MS-Paint. |
Beta Was this translation helpful? Give feedback.
-
@jgrossrieder There are several layout combination to get that and the results depends on the uses. <Window x:Class="WpfApp4.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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:svgc="http://sharpvectors.codeplex.com/svgc/"
xmlns:local="clr-namespace:WpfApp4"
mc:Ignorable="d"
Title="MainWindow" Height="720" Width="400">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<Image Source="{svgc:SvgImage Source=SingleExpansionCollar.svg, AppName=WpfApp4}"/>
<Image Source="{svgc:SvgImage Source=SingleExpansionCollarBottom.svg, AppName=WpfApp4}" Margin="100 50 20 10"/>
</StackPanel>
</Window> Here I used the margin property on the bottom image to both constrain the position and size. The results is shown below: The same results with <Window x:Class="WpfApp4.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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:svgc="http://sharpvectors.codeplex.com/svgc/"
xmlns:local="clr-namespace:WpfApp4"
mc:Ignorable="d"
Title="MainWindow" Height="720" Width="400">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<svgc:SvgViewbox Source="SingleExpansionCollar.svg"/>
<svgc:SvgViewbox Source="SingleExpansionCollarBottom.svg" Margin="100 50 20 10"/>
</StackPanel>
</Window> Or using the <Window x:Class="WpfApp4.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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:svgc="http://sharpvectors.codeplex.com/svgc/"
xmlns:local="clr-namespace:WpfApp4"
mc:Ignorable="d"
Title="MainWindow" Height="720" Width="400">
<DockPanel HorizontalAlignment="Center">
<svgc:SvgViewbox Source="SingleExpansionCollarBottom.svg" Margin="200 50 20 50" DockPanel.Dock="Bottom"/>
<svgc:SvgViewbox Source="SingleExpansionCollar.svg"/>
</DockPanel>
</Window> And finally, a little different layout using the <Window x:Class="WpfApp4.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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:svgc="http://sharpvectors.codeplex.com/svgc/"
xmlns:local="clr-namespace:WpfApp4"
mc:Ignorable="d"
Title="MainWindow" Height="620" Width="400">
<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<svgc:SvgViewbox Source="SingleExpansionCollar.svg" Grid.Row="0" Margin="10"/>
<svgc:SvgViewbox Source="SingleExpansionCollarBottom.svg" Grid.Row="1" HorizontalAlignment="Right"
Height="60" Margin="10 30"/>
</Grid>
</Window> |
Beta Was this translation helpful? Give feedback.
-
@jaytonic I have just tried looking at the files and there is no extra spaces added. For the sample below, I added border to see the extend of the images: Maybe <Window x:Class="WpfApp4.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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:svgc="http://sharpvectors.codeplex.com/svgc/"
xmlns:local="clr-namespace:WpfApp4"
mc:Ignorable="d"
Title="MainWindow" Height="420" Width="600">
<Canvas>
<Border BorderBrush="Red" BorderThickness="1" Canvas.Left="10" Canvas.Top="10">
<Image x:Name="CallarBottom" Stretch="None"
Source="{svgc:SvgImage Source=SingleExpansionCollar.svg, AppName=WpfApp4}"/>
</Border>
<Border BorderBrush="Red" BorderThickness="1" Canvas.Left="100" Canvas.Top="100">
<Image Stretch="None" Source="{svgc:SvgImage Source=SingleExpansionCollarBottom.svg, AppName=WpfApp4}"/>
</Border>
</Canvas>
</Window> You can convert to image using |
Beta Was this translation helpful? Give feedback.
-
@jaytonic OK, setting EnsureViewboxSize property to true and turning off the others, could work for your case, but I do not think combining multiple controls will produce the results you want. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I've 2 SVG that I want to overlay.
One is the main image, always displayed, taking the full height/width.
The second one(linked) is only on the bottom of the image. But when I superpose them, it gets displayed on the middle:
Is there a way to have the second image(...Bottom.svg) that takes the full space without trimming the whitespace?
CollarSingle.zip
Beta Was this translation helpful? Give feedback.
All reactions