首页 文章

在WPF应用程序中显示一个巨大的图像

提问于
浏览
0

我想在我的WPF应用程序中显示高清大小的1920X1080图像 . 当我在图像控件中设置图像源时,仅显示图像的一部分,图像控制的大小 .

我不希望自动将高清图像融入图像控件 . 假设图像控制尺寸为640 X 480,则应显示640X480的高清图像 . 但是当我平移图像时,应显示下一个640 X 480的图像 . 我已经实现了TransformGroup TransformGroup group = new TransformGroup(); ScaleTransform xform = new ScaleTransform(); group.Children.Add(XForm的); TranslateTransform tt = new TranslateTransform(); group.Children.Add(TT);

但我的问题是最初没有加载整个图像 .

1 回答

  • 0

    如果你想要的只是能够滚动你的图像...然后使用:

    <Window x:Class="WpfApplication1.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 HorizontalScrollBarVisibility="Visible">
                <Image Stretch="None" Source="c:\mytestimage.png" />
            </ScrollViewer>
        </Grid>
    </Window>
    

    如果您想要更高效/更高效,请参阅这些方便的帖子:

相关问题