Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display SVG in Eclipse?

I'm new to Eclipse and trying to display a SVG file in an Eclipse program. I have downloaded Batik plugin and installed it. This is my first time working with plugins so I don't know anything. I would like to display a SVG picture when I click on a button. Thanks.

like image 618
Sandy Avatar asked Jun 28 '11 09:06

Sandy


People also ask

How do I visualize an SVG file?

From Chrome and Edge to Safari and Firefox, all the major browsers allow you to open SVG files these days — whether you're on a Mac or Windows. Just launch your browser and click on File > Open to choose the file you want to view. It'll then be displayed in your browser.

Is SVG in XML format?

SVG is an application of XML and is compatible with the Extensible Markup Language (XML) 1.0 Recommendation [XML10] SVG is compatible with the Namespaces in XML Recommendation [XML-NS]

How do I display SVG on my website?

SVG images can be written directly into the HTML document using the <svg> </svg> tag. To do this, open the SVG image in VS code or your preferred IDE, copy the code, and paste it inside the <body> element in your HTML document. If you did everything correctly, your webpage should look exactly like the demo below.


1 Answers

One possible option is to open a view/editor with the embedded SWT browser. Many browsers now support SVG content, so you could generate inline SVG inside an HTML document and set the browser to display it. See http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet136.java?view=co and others at http://www.eclipse.org/swt/snippets/

like image 51
Christopher Williams Avatar answered Oct 14 '22 07:10

Christopher Williams