Chris
Chris

Reputation: 3

How paint.net accomplish it: show pixel coordinates when mouse is moving

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.

Upvotes: 0

Views: 1530

Answers (2)

Benny
Benny

Reputation: 8815

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

see: Back track the mouse

Upvotes: 0

SLaks
SLaks

Reputation: 887415

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.

Upvotes: 6

Related Questions