tags:

views:

183

answers:

2

There is a picture in my winform, I want to show pixel coordinates when mouse is moving, and whether zoom in or out, the same pixel's coordinates don't change, just like what paint.net does. Appreciate for any idea.

+5  A: 

You need to handle the MouseMove event and get the location from e.X and e.Y.

You can divide the location by your zoom factor.

SLaks
A: 

about the mouse coordinate, you should use Matrix to track back mouse coordinate.

see: Back track the mouse

Benny
This is only helpful if he's already using a `Matrix` for zoom and pan. If he isn't, this will be less efficient than transforming it manually and won't actually do any good.
SLaks
yes. agree. and i think Matrix is better way to do zoom staff.
Benny
You're right, but it is unlikely that he's using it.
SLaks