我从C#代码中获得了所需的输出图形,图形的长度很大,我只能查看其中的一部分。我尝试使用ScrollViewer。但是我看不到ScrollViewer。
Title="Graphs" Height="350" Width="550" >
<Grid x:Name="grid">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Button Grid.Row="0" Content="Select File" Height="32" Width="88" HorizontalAlignment="Left" VerticalAlignment="Top"
Margin="20,10,10,10" Name="button1" Click="button1_Click" />
<ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Auto"
Height= "150" Width="200">
<Canvas x:Name="front_canvas" Height="350"/>
</ScrollViewer>
</Grid>
答案 0 :(得分:0)
@ user3261186可能是正确的,如果要进行缩放,请尝试将控件放在Viewbox
内:
<Viewbox HorizontalAlignment="Left"
VerticalAlignment="Top"
Height="1400" Width="1500"
Name="viewbox1"
Stretch="Fill">
</Viewbox>