1

我找到了一个弹出图像的好例子:http: //tozon.info/blog/post/2007/10/14/three-ways-to-make-your-wpf-images-pop-out-on-mouseover .aspx

问题是我需要向相反的方向发展。示例中的图像从左到右增长。我希望它长到左侧。

<!-- This storyboard will make the image grow to double its size in 0.2 seconds -->
<Storyboard x:Key="expandStoryboard">
  <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX"
                   To="2"
                   Duration="0:0:0.2" />
  <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY"
                   To="2"
                   Duration="0:0:0.2" />
</Storyboard>
<!-- This storyboard will make the image revert to its original size -->
<Storyboard x:Key="shrinkStoryboard">
  <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX"
                   To="1"
                   Duration="0:0:0.2" />
  <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY"
                   To="1"
                   Duration="0:0:0.2" />
</Storyboard>
4

1 回答 1

3

用于通过在后面的代码或XAML中RenderTransformOrigin定义原点来使图像从右到左弹出。如果您希望图像从右下角向外扩展,您可能需要使用yOrigin不是。new Point(1,0.5)<Image ... RenderTransformOrigin="1,0.5" />10.5

于 2013-04-11T16:50:04.323 回答