2 yfp15062328347 yfp15062328347 于 2016.03.22 11:21 提问

图片放大后,拖动图片,不想让Border里有余白。Border的下边吻合后,图片就不能再网上拖了。

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Name="WPFWindow"
Title="WPF Pan And Zoom"
mc:Ignorable="d"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Height="610"
Width="566">

<Grid x:Name="LayoutRoot" >
    <Grid.RowDefinitions>
        <RowDefinition Height="52.92"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>

    <Border Grid.Row="1" Name="border" ClipToBounds="True" Width="650" Height="500">
        <Image Name="image" Opacity="1" Source="/WPF%20Image%20Pan%20and%20Zoom;component/Images/test.tif" />
    </Border>

    <Label Content="Mousewheel to zoom. Hold left mousebutton to pan." Height="35" HorizontalAlignment="Center" Margin="123,12,128,0" Name="label1" VerticalAlignment="Top" Width="293" />
</Grid>

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!