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

Problem with Markers

Topics: Markers
Dec 15, 2011 at 4:21 PM

Thank you very much this code is great and thanks for sharing. However, There seems to be a problem with some of the Marker code. I saved a Visio file with arrow heads or other markers as SVG, and when using this to display the markers were wrong not on the right spot or sometimes scaling wrong (maybe some transform not applied properly). It did display fine in ViewerSVg and InkScape.
 
I am working on getting to turn the toplevel shapes into UIElements so as that I can capture click events and what-not. I hope to get the DrawingGroup and use at as the Visual for a Rectangle shape. Do you think this is the right way to go about this?

Coordinator
Jan 13, 2012 at 1:09 AM
Edited Jan 13, 2012 at 1:10 AM

The marker is a known and pending issue.

http://sharpvectors.codeplex.com/workitem/417

The interactivity is also a known and pending issue, the UI Element support is also required
for Silverlight - which seems to be dying now!

http://sharpvectors.codeplex.com/workitem/413

http://sharpvectors.codeplex.com/workitem/422

The UI Elements will require another renderer. Currently we have two; WPF (low-level) and GDI+.
We need to add another WPF (high-level). The high-level gives you automatic interactivity, with
the exception of script support.
The plan is to get the faster low-level support completed to a higher degree first and then port it
to the high-level to avoid duplication and maintenance issues. 

I think it will be a good idea to vote and comment on the pending issues in the Issue Tracker, to
increase the priorities. 

Best regards,
Paul. 

Jan 13, 2012 at 7:49 PM

I added comments to the marker issue. I also attached 2 files that display the problem. I created these files using Visio, which is what I am using for all the files I use in the software that uses your libraries.

I would be willing to help and try to fix it. If you have any insight as to what the issues are. I know the heart of the issue would seem to lie at the WpfMarkerRendering class. There are already 3 versions of the RenderMarker method

As for UIElements, I hacked a work around (which I am happy with what I need it for in my project). After the svg document is loaded, I walk the XML to capture the top-level 'g' shapes and capture their Ids from the XML (keeping in mind your transformation of them). This works for me, because I know how my SVG file is usually structured coming out of Visio (Visio adds an attribute to the 'g' tag that represents a page I then iterate that tag's nested 'g' tags). Then when your code produces a DrawingGroup I recursively iterate it's children and peel off any DrawingGroup who's Id/name matches one of my "top level objects". I then get that drawing's Bounds and use it to get height/width and x/y information to create a UIElement which I then fill with a VisualBrush created with the drawing and viola, I got myself UIElements. I did have some issues I had to work around some top-level shapes produced from Visio where 'a' tags with a nested 'g' if the shape had a hyperlink. Also, there were 'use' tags that referenced 'symbol' tags that had nested 'g' tags. Problem there was that you only named/id'd the drawing that was produced from the referenced 'g' which was okay until 2 'use' tags referenced the same symbol, now they weren't unique and only one drawing got id'd. I worked around this by having the outer drawing for the 'use' tag also add a name/id in its BeforeRender method.

Thanks for everything