SilverBrother
WPF mousePos and icon.Margin align. Visual rep does not.
So I'm trying to make an icon visible in a map at the same position as the mouseclick, but it always appears somewhere in the bottom right quadrant. What am I not seeing? It is like there is a layer askewed to the map .Here's the xaml bit
There's only a grid and a page as ancestors. No attributes on the grid. And here are the C# code
Let me know if you need more for this to make sense. Thank you so much in advance.
2 replies
WPF Image Zoom fixed to absolute window position and not relative mouseposition
- The title explains the issue briefly. So I'm making a simple App with WPF where I want to be able to zoom in and out on images. When I zoom in on the first mouse position it does as intended, but if I move the mouse to a different position it is like the program assumes that it is zooming in on the mouse position related to the original unzoomed image, instead of the position on the zoomed image. I.e. I have a Europe map and first step I zoom in on Berlin without moving the mouse, second step, I now want to zoom in on a street in the south western Berlin, but instead the App zooms (pans) down to Spain due to the cursor's position in the original image. I hope it makes sense. I don't think there are issues in the WPF, but I'm missing something in the C# file. Here it is
2 replies