This project has moved and is read-only. For the latest updates, please go here.

screenY always 0 Is this an error?

Topics: WPF and GDI+ Renderers
May 27, 2013 at 8:07 AM
Using this SharpVectors.Dom.Events.MouseEvent me = (MouseEvent)e;
I notice that me.screenY is always 0. screenX, clientX, clientY to change. Possible error??

I am trying to soft split a line. But I need to know not just the mouse position (or clientX,clientY) but also the scale factor used for drawing. I am unable to locate this. Any direction on where it can be found, assuming that it is exposed?

By soft split, I want to select any 2 points on a selected line and the know the real-world distance between them. I know the real-world length of the line. I don't want to select the beginning and end of line for my scaling points. Just select 2 points on the line.

Any suggestions??
Coordinator
May 29, 2013 at 3:29 PM
Hello Ernest,
SharpVectors does not currently support the interactivity part of the SVG, that is why the current use is mainly conversion.
The interactivity must be done through Javascript integration.

However, if you render the WPF vector drawings on a surface (control, canvas), you can monitor events from the surface
and response accordingly. Simply, it is then just WPF application.

With the WPF drawing, you can perform hit-test and select or determine any element(s) under the mouse.
You can look into the controls and canvases provided as a starting point.

Best regards,
Paul.
May 30, 2013 at 12:53 AM
HI Paul,

Thank you for the explanation. I'm not familiar with WPF and seeing the project was urgent, (aren't they all, always!) there was very little time to learn WPF.

I have managed a kind of work around with the user having to provide some additional clicks on the element. It seems to work. (I'm using C# VS2012) I am able to do what I want to do, but not quite as elegant as I would like.

I am very pleased with the DLLs. You have clearly put a lot of work into them and for this I thank you.

regards & thanks

Ernest


On 29/5/2013 10:30 PM, SelormeyPaul wrote:

From: SelormeyPaul

Hello Ernest,
SharpVectors does not currently support the interactivity part of the SVG, that is why the current use is mainly conversion.
The interactivity must be done through Javascript integration.

However, if you render the WPF vector drawings on a surface (control, canvas), you can monitor events from the surface
and response accordingly. Simply, it is then just WPF application.

With the WPF drawing, you can perform hit-test and select or determine any element(s) under the mouse.
You can look into the controls and canvases provided as a starting point.

Best regards,
Paul.

-- 
Ernest Abbott
Research Engineer
National University of Singapore
E1-08-21
Tel: +65-6516-4643