In a wpf control with zoom functionality I calculate from the MouseWheelEventArgs how to scale the drawing canvas to implement the zoom effect.
Point mouse = e.GetPosition(myCanvas);
Matrix m = myCanvas.RenderTransform.Value;
if (e.Delta > 0)
{
f = 1.1;
}
else
{
f = 1.0 / 1.1;
}
m.ScaleAtPrepend(f, f, mouse.X, mouse.Y);
myCanvas.RenderTransform = new MatrixTransform(m);
I would like to know the actual size of one of the circles on the canvas. However Width, ActualWidth and such stay the same while zooming in and out (16.0). How would you determine (calculate?) the size of the circle that a user actually sees on his or her screen?