Here's a crude example of an image on a view that rotates around its center when dragged.
In a new project add this XAML
<Image x:Name="TheImage"
Source="Assets/StoreLogo.png"
Width="200"
Stretch="Uniform"
RenderTransformOrigin="0.5,0.5"
PointerPressed="OnPointerPressed"
PointerMoved="OnPointerMoved"
PointerReleased="OnPointerReleased">
<Image.RenderTransform>
<RotateTransform x:Name="ImageRotation" />
</Image.RenderTransform>
</Image>
and here's the accompanying code-behind
private bool pointerCaptured = false;
private Point lastPosition;
private void OnPointerPressed(object sender, PointerRoutedEventArgs e)
{
pointerCaptured = true;
this.lastPosition = e.GetCurrentPoint(TheImage).Position;
}
private void OnPointerMoved(object sender, PointerRoutedEventArgs e)
{
if (pointerCaptured)
{
Point currentLocation = e.GetCurrentPoint(this.TheImage).Position;
double radians = Math.Atan((currentLocation.Y - lastPosition.Y) /
(currentLocation.X - lastPosition.X));
var angle = radians * 180 / Math.PI;
// Apply a 180 degree shift when X is negative so can rotate all of the way around
if (currentLocation.X - lastPosition.X < 0)
{
angle += 180;
}
lastPosition = currentLocation;
this.ImageRotation.Angle = angle;
}
}
private void OnPointerReleased(object sender, PointerRoutedEventArgs e)
{
pointerCaptured = false;
}
Hat tip for some of teh rotation math to https://stackoverflow.com/a/963099/1755