1

単一の画像とポリゴンがオーバーレイされたダイアログを作成しています。問題は、画像の縮尺がポリゴンの縮尺と異なるため、ポリゴンの縮尺に合わせて画像を縮小したいということです。しかし、RenderTransform/ScaleTransform タグを使用すると、画像のサイズが小さくなり、ダイアログの右側と下部に空白が残ります。はい、オーバーレイは適切に機能するようになりましたが、ウィンドウを埋めるために使用可能なスペースを埋めたいと思います。

<Window x:Class="vw.CollImage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Collection Image" Height="700" Width="700"
    WindowStartupLocation="CenterOwner" Grid.IsSharedSizeScope="False"
    Icon="Resources\ty.ico">

    <Viewbox MinWidth="70" MinHeight="70">
        <Grid>
            <Image Name="imgColl" HorizontalAlignment="Left" VerticalAlignment="Top" Source="{Binding ImageData}">
                <Image.RenderTransform>
                    <ScaleTransform ScaleX="0.75" ScaleY="0.75"/>
                </Image.RenderTransform>
            </Image>
            <Polyline Stroke="OrangeRed" StrokeThickness="6" Points="{Binding Coordinates}"/>
        </Grid>
    </Viewbox>
</Window>
4

1 に答える 1

6

代わりに適用しLayoutTransformます。

于 2012-02-13T18:58:29.970 に答える