SVG to Silverlight Workbench
Notes:
- Requires the Silverlight plugin to see the silverlight rendering, and a browser that supports SVG to see the SVG rendering.
- This is a work in progress. Conversion of many SVG features (e.g.,
viewBox,use,xlink, and many, many more) are not yet supported. The only feature to date that I have found that I can’t directly support is text-anchor. - As this is displaying SVG inside of HTML (vs. XHTML), some SVG features may not display properly. In particular, in this iteration xlink isn’t supported. This is a solved problem, it is just that the code necessary isn’t in place just yet.
- On Firefox, the two
textareas are live: make a change to the SVG and see both the Silverlight equivalent and both images update. Make a change to the Canvas, and see the rendering update. For reasons not yet debugged, this doesn’t work on IE. - You can directly observe the ultra-draconian nature of Silverlight by changing the name of any single element or attribute.
- This code is really, really, grungy. At the moment, I’m simply hacking to see what is possible. Serious refactoring will ultimately be required.
Feel free to view-source, submit patches, or make suggestions. I’m particularly interested in feedback from people who know Silverlight. Some of the Silverlight renderings are incomprehensible to me, for example: this one.
links
Sam Ruby plays with silverlight. Virtual Hosting With PureFTPd And MySQL (Incl. Quota And Bandwidth Management) On Debian Etch...Excerpt from Adnans Sysadmin/Dev Blog at
Does anyone have any idea about the DOM for WPF/E? How realistic is it to wish for JS that could access either DOM?
Posted by Jeff Schiller at
Very cool Sam!
Jeff - It is very easy to manipulate both the browser dom and Silverlight DOM and the ASP.NET Futures release we did makes it even easier... I did a demo of this at AjaxWorld a while back when Silverlight was still WPFE...
[link]
Check out the $getXaml() in last screen shot for example
Sam Ruby: SVG to Silverlight Workbench
This is a work in progress. Conversion of many SVG features (e.g., viewBox, use, xlink, and many, many more) are not yet supported....Excerpt from del.icio.us/tag/svg at
Silverlight resources
Resources: silverlight.net MSDN Silverlight Dev Center Silverlight tools & resources Some articles: SilverLight, Flash, and SVG Sam Ruby: SVG to Silverlight Workbench Why Silverlight Is Important...Excerpt from Silverlight Development at
Possibly not exact, but the following renders closer to the SVG version of the caution sign:
<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> <Path Stroke="#000" Canvas.Top="80" Canvas.Left="7.5" Fill="#fff" StrokeThickness="2" Data="M8,-15s-5,8,5,9l78,0s9,0,5-9l-40-71s-4-6-8,0z"/> <Path Stroke="#000" Fill="#fc0" StrokeLineJoin="Round" StrokeThickness="2" Data="M52,10 L10,85 L93,85z"/> <Path Stroke="#000" StrokeEndLineCap="Round" StrokeStartLineCap="Round" StrokeThickness="9" Data="M52,32l0,26" Fill="#000"/> <Ellipse Stroke="#000" Canvas.Top="67" Canvas.Left="46" Width="12" Height="12" Fill="#000"/> </Canvas>Posted by n4cer at
Good catch on StrokeStartLineCap.
Consistent SVG/Silverlight behavior can be achieved with absolute positioning:
M8,80S3,88,13,89L91,89S100,89,96,80L56,9S52,3,48,9Z
Looks to me like there might be a Silverlight bug with the relative versions of the shorthand/smooth curveto commands.
Posted by Sam Ruby atc3o: Sam Ruby: SVG to Silverlight Workbench
Sam Ruby: SVG to Silverlight Workbench Here’s an interesting use for Silverlight: Render SVG or Canvas content through it....Excerpt from Planet Metalab at
Silverlight Samples
There’s a lot of Silverlight in the air right now. I haven’t seen the 'net abuzz like this since FutureSplash Animator . ;) I’ve been collecting links to samples out there. Since Silverlight is all text (XAML, JS, etc) there’s a whole world of...Excerpt from Scott Hanselman's Computer Zen at
Silverlight Samples
Lutz’s Silverlight Monotone - Reminds me of the demo scene on C64 Digger - really a Boulderdash game clone Inplay - MP3 player. Listen to Hanselminutes if you like. DLR/Dynamic Silverlight Samples There’s a pile here, make sure you get the...Excerpt from Barkga at
Nice work, but still a pity to see how easy it is to change the syntax from SVG to XAML and yet IE doesn’t do it natively. They keep creating these one-way doors from other technologies to MS specific technologies. Am I the only one seeing this?
Posted by Jacobus at
Silverlight and XAML, have you guys met Old Man SVG?
XAML and SVG, separated at birth? Windows Presentation Foundation introduced vector graphics as a first... [more]Trackback from Jon Galloway at
Silverlight and XAML, have you guys met Old Man SVG?
Summary XAML uses a vector graphics markup which is very similar to SVG, but since it’s part of a complete application framework the designers decided to use a slightly different format. I’d expect that XAML would be able to load...Excerpt from Jon Galloway at
SVG to XAML Convertor
This is a very useful tool for anyone doing WPF development (not only Silverlight). If you are using WPF and the Silverlight image at the bottom doesn’t look right don’t worry, the generated XAML usually works well in the “full” WPF, you can test...Excerpt from Nir's Software Company at
Moonlight
It looks like my little demo was used to help debug. Sweet!... [more]Trackback from Sam Ruby at
Here is the list of things I have:
SilverLight plugin installed in IE
An SVG file waiting to be converted into XAML
Given this, how do I use your information above to render my SVG on IE using SilverLight plugin?
Posted by shiela atSVG Open 2007 Live from Tokyo
SVG open 2007 has started this morning in Tokyo. SVG 101 A bright sun, it is 9:56am, and I’m following a session given by Doug Schepers on SVG 101, explaining the basis of SVG. SVG is a language for describing......Excerpt from W3C Q&A Weblog at
svg.startpagina.nl
A ton of SVG resources. and the SVG To Silverlight Workbench. [link] Have fun! svg.startpagina.nl...Excerpt from Silver Lighting - My Silverlight Blog at
Ruby, Python and Silverlight
It was about 5 years ago (March of 2002 by my records) that Miguel de Icaza and Sam Ruby tried to convince us to ship our own Ruby runtime for .NET, and we thought it was a swell idea. That was probably before DHH heard of...Excerpt from MIX at
SVG to Silverlight
Is there any simple way to convert a SVG to Silverlight? I found the following site with wath i need : [link] But i would like to use this on my own application. Any web service i...Excerpt from Silverlight at
I will start a web application. Should I use silverlight or wpf? Would you give me advice?
Thank you.
<a href="http://www.linq-to-sql.com" title="linq" rel=”muse”>linq</a>
"Silverlake"?
Posted by Jesper at