Here is my XAML:
<Image
VerticalAlignment="Center" HorizontalAlignment="Center"
Source="{Binding Input, Converter={StaticResource ByteArrayToBitmapConverter}}">
<Image.RenderTransform>
<RotateTransform Angle="{Binding RotateAngle}" CenterX="100" CenterY="100"></RotateTransform>
</Image.RenderTransform>
</Image>
I’m binding image to data source and use converter to get Bitmap. That part works. However, I want to make it rotate and I set RotateAngle in my VM. Problem is – all images have different dimensions, I don’t know how to set CenterX and CenterY. Is there any other way to just change orientation without calculating additional X and Y?
Don’t have time to test this myself but I think RenderTransformOrigin might work for you.
</code></pre>