0
裏面我嘗試在我的窗口中顯示的圖像:WPF無法滾動的圖像的ScrollViewer
<Window x:Class="Problem.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">
<DockPanel>
<StackPanel Orientation="Vertical">
<ScrollViewer VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Visible">
<Image Source="cat.jpg" Stretch="Uniform">
<Image.LayoutTransform>
<RotateTransform Angle="90" />
</Image.LayoutTransform>
</Image>
</ScrollViewer>
</StackPanel>
</DockPanel>
</Window>
其中cat.jpg爲1920×1080的圖像。
下面是結果:
正如你所看到的,是VerticalScrollbar雖然我不能看到完整的貓頭禁用。此外,HorisontalScrollBar是隱形的。
我的問題是:如何啓用滾動條來滾動我的圖片?
在我真正的代碼,我需要在我的形象 – Epitouille
以層疊的ButtonBar那麼你應該移動的StackPanel內ScrollViewer中。 – Domysee
我編輯了代碼來表示這個 – Domysee