سؤال

I saw a couple of examples which is being done through the flash classes. But that wont work in dhtml environment. For dhtml environment I have to create a separate iframe component or some thing of that sort so that the browser will take care of that. Is there any better approach? I also want to know if has any inbuilt support for ?.

هل كانت مفيدة؟

المحلول

There is no built-in support for SVG in OpenLaszlo. But it's still possible to use SVG in both runtimes, if you create your custom component with 3rd party libraries.

Flash/Flex support embedding SVG files at compile time only, not runtime. There's no API for using that feature in OpenLaszlo.

For SWFx, instead you could utilize SVG Web, a JavaScript library which provides SVG support on many browsers, including Internet Explorer, Firefox, and Safari. Using the library plus native SVG support you can instantly target ~95% of the existing installed web base. SVG Web includes an ActionScript based SVG renderer. That source code could be reused to add SVG support to the SWF runtime, by compiling a modified version of the tool into an SWC for OpenLaszlo.

Another option for SWF runtime is http://labs.zavoo.com/content/flex/DrawSvg/srcview/index.html

All modern browser support SVG by now: http://caniuse.com/svg You can create your own view with an SVG added as a child of the display object. Just make sure you set the correct CSS style so the SVG does get scaled to the size of the parent DIV.

Stackoverflow has some good examples showing you how to dynamically add an SVG to an HTML page, e.g. How do I dynamically insert an SVG image into HTML?

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top