|
Group: Forum Members
Posts: 35,
Visits: 32
|
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
|