'How to use SVGGraphics2D to generate a rectangle and set radialGradient and opacity properties
DOMImplementation domImpl =
GenericDOMImplementation.getDOMImplementation();
String svgNS = "http://www.w3.org/2000/svg";
org.w3c.dom.Document document = domImpl.createDocument(svgNS, "svg", null);
SVGGraphics2D svgGenerator = new SVGGraphics2D(document);
svgGenerator.drawRect(50,50,200,200);
Writer out = new OutputStreamWriter(new FileOutputStream("D:\\5.svg"));
svgGenerator.stream(out, false);
I will only use SVGGraphics2D to draw some basic graphics, how to set the complex properties of these graphics, such as opacity, radialGradient, linearGradient, etc. Thank You!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
