0
這最終可能是一個非常愚蠢的問題,所以請原諒我,如果這很簡單 - 我是相當新的Silverlight的:)如何將Image.RenderTransform標籤的ScrollViewer內添加到圖像中的Silverlight
什麼我想要做的是將下面的Image.RenderTransform示例添加到我自己的項目中,但是我的圖像控件位於滾動查看器中,並且每當我嘗試添加它時,都會收到以下消息:
「可附加屬性」RenderTransform「在「Image」中找到
<Image MaxHeight="220" MaxWidth="200" Name="image1" Stretch="Uniform" Source="/FunWithMouseWheel;component/Images/sl4bloglogo.png" MouseWheel="image1_MouseWheel" Margin="531,346,124,199">
<Image.RenderTransform>
<ScaleTransform x:Name="imageScale"></ScaleTransform>
</Image.RenderTransform>
</Image>
我的XAML文件:
<UserControl x:Class=Image_Viewer.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk">
<Grid x:Name="LayoutRoot"
Background="White" Height="717" Width="1086">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="713*" />
<ColumnDefinition Width="456*" />
</Grid.ColumnDefinitions>
<Button Content="Button" Height="35" HorizontalAlignment="Left" Margin="10,10,0,0" Name="btnGet" VerticalAlignment="Top" Width="115" Click="btnGet_Click" />
<Button Content="Rotate Left" Height="35" HorizontalAlignment="Left" Margin="132,10,0,0" Name="btnRotateLeft" VerticalAlignment="Top" Width="115" />
<ScrollViewer Grid.ColumnSpan="2" Height="520" HorizontalAlignment="Left" Margin="37,60,0,0" Name="scrollViewer" VerticalAlignment="Top" Width="840" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<ScrollViewer.Background>
<LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
<GradientStop Color="#FF89D2FC" Offset="0" />
<GradientStop Color="#00009AFF" Offset="1" />
</LinearGradientBrush>
</ScrollViewer.Background>
<Image Height="465" Name="imgData" Stretch="Uniform" Width="767" MouseLeftButtonDown="imgData_MouseLeftButtonDown" MouseWheel="imgData_MouseWheel" />
<Image.RenderTransform></Image.RenderTransform> <----- causes the error
</ScrollViewer>
<Slider Height="248" HorizontalAlignment="Left" Margin="222,60,0,0" Name="slider" VerticalAlignment="Top" Width="39" Orientation="Vertical" Grid.Column="1" />
</Grid>
</UserControl>
感謝任何幫助!