Displaying vector graphics in a browser

依然范特西╮ 提交于 2019-12-03 05:23:30

Safari, Opera and Firefox all support SVG natively (eg. without plugins) to varying degrees of completeness and correctness, including the ability to script the svg from javascript.

There's also the canvas element which is now being standardised in html5, and is already supported in the above browsers as well (with various quirks in certain edge cases due to relatively recent changes in the html5 draft).

Unfortunately any standards based approach is kind of destroyed by IE's willful disregard of what is happening outside its own ecosystem, however there are a number of libraries that try to convert canvas/svg into VML (IE's proprietary vector language) such as iecanvas.

[Edit: whoops, i forgot my favourite js library -- Cake! which can parse and display svg in canvas, and believe supports IE as well]

[Yet another edit: Cake actually has a demo doing what i think you want to do]

Take a look at the Raphael Javascript library. It's early days but it looks very promising.

I remember the IE roadmap that had SVG support listed in IE7.2.

Depends on how interactive you want it?

Can you clarify what you mean by the "Windows lock-in" thing with Silverlight? It runs on Windows and MacIntel, and the vector portions run just fine on Linux with the Moonlight plugin.

Were you thrown off by the lack of Amiga support?

Have a look at the new Canvas element which has been implemented in many browsers. I heard also that there is an ActiveX control for IE that implements the Canvas element too.

Update: Wait, you already said that. I should read the whole question next time! :)

Walter Zorn has a JavaScript library for arbitrary vector graphics. It looks decent.

Go for SVG - and just tell the users to get the ADOBE SVG plug in for IE.

See this excellent site - which is a UK Government Site (public service)

ELGIN

IE supports VML, but nothing else does and it's ugly. Microsoft claimed that they'd dropped it (with new XAML and all) but it's still part of their Office XML format (it's how Excel .xlsx supports comments, weirdly enough).

FX and loads more support the new Canvas element. Many support SVG, but given the work MS are doing on Silverlight I can't see IE supporting SVG any time soon.

Microsoft are supposed to be providing Silverlight plug ins for no MS operating systems.

I've been using Flex - it's pretty good despite using Eclipse. You don't need to buy the hugely expensive Adobe server components to use Flex - it can consume SOAP services.

The dev tools for Flex are quite affordable, and nearly everyone has Flash.

I don't think SVG is a good choice for the future. From Wikipedia:

  • "The most common IE plugin was produced by Adobe. Adobe, however, are planning to withdraw this product at the beginning of 2009"
  • "... Internet Explorer which will also not support SVG in the upcoming version IE8"
  • "...all have incomplete support for the SVG 1.1..."
  • "The Corel SVG Viewer plugin was once offered from Corel. Its development has stopped."

Of all the possibilities you list, the only one that's not a horrible abuse of an existing technology (Javascript), barely supported (SVG, Canvas element) or a lot of work (Java) is Flash. It was designed as a vector graphics package and is compatible with more browsers than SVG and the canvas tag.

The only reason I wouldn't choose Flash over all other options is if you're aiming at mobile browsers or don't have the budget for the Flash package.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!