I am creating a simple WPF application that should combine a couple of images in a scroll pane. These images should have absolutely no border, which should not be a problem with proper positioning.
When I launch the application, everything is displayed as intended. But when I start to scroll some (white) borders between images. (See screenshot)

I think the same problem will occur when I start scaling / scaling inside ScrollViewer .
So my question is how to avoid such boundaries using WPF and especially inside ScrollViewer ?
The following code should be sufficient to reproduce the problem:
<Window x:Class="Test.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Grid> <ScrollViewer HorizontalAlignment="Stretch" Name="scrollViewer1" VerticalAlignment="Stretch" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"> <Grid> <Grid Background="Black" Width="500" Height="500" VerticalAlignment="Top" HorizontalAlignment="Left"/> <Grid Background="Black" Width="500" Height="500" Margin="500,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Left"/> <Grid Background="Black" Width="500" Height="500" Margin="500,500,0,0" VerticalAlignment="Top" HorizontalAlignment="Left"/> <Grid Background="Black" Width="500" Height="500" Margin="0,500,0,0" VerticalAlignment="Top" HorizontalAlignment="Left"/> </Grid> </ScrollViewer> </Grid>
source share