Tuesday, June 15, 2010

Image Render Transformations

Image binding to Viewmodel :

  • ImageData (bitmap data)
  • ZOOM (zooming)
  • TX / TY (translation)
<Image Stretch="None" Source="{Binding Path=ImageData, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" > 
<Image.LayoutTransform>
<ScaleTransform ScaleX="{Binding Path=ZOOM}" ScaleY="{Binding Path=ZOOM}" />
</Image.LayoutTransform>
<Image.RenderTransform>
<TransformGroup>
<TranslateTransform X="{Binding Path=TX}" Y="{Binding Path=TY}"/>
</TransformGroup>
</Image.RenderTransform>
</Image>

No comments:

Post a Comment