Group: Forum Members
Last Active: 2 Months Ago
Posts: 35,
Visits: 15
|
Hi,
Client coordinates for the drawing view can be converted to scene coordinates (document) with the help of the drawingView.SceneToDevice transformation. For example: if you have a point in client coordinates (e.g. relative to the drawing view control) you can convert to document coordinates like this:
NPointF pt = new NPointF(clientX, clientY); pt = nDrawingView1.SceneToDevice.InvertPoint(pt);
If the mouse coordinates are in screen coordinates you have to first convert them to control client coordinates like this:
Point pt = new Point(screenX, screenY); pt = nDrawingView1.PointToClient(pt);
Hope this helps...
Best regards, Ivo
|
Group: Forum Members
Last Active: 15 Years Ago
Posts: 10,
Visits: 1
|
Hi,
How can I translate mouse position Point(int, int) to document coords NPointF(float, float)?
Thanks in advance, Michal
|