MCPcopy Index your code
hub / github.com/arduino/Arduino / imageFromSVG

Method imageFromSVG

app/src/processing/app/Theme.java:605–618  ·  view source on GitHub ↗
(URL url, int width, int height)

Source from the content-addressed store, hash-verified

603 }
604
605 private static Image imageFromSVG(URL url, int width, int height)
606 throws TranscoderException {
607 Transcoder t = new PNGTranscoder();
608 t.addTranscodingHint(PNGTranscoder.KEY_WIDTH, new Float(width));
609 t.addTranscodingHint(PNGTranscoder.KEY_HEIGHT, new Float(height));
610
611 TranscoderInput input = new TranscoderInput(url.toString());
612 ByteArrayOutputStream ostream = new ByteArrayOutputStream();
613 TranscoderOutput output = new TranscoderOutput(ostream);
614 t.transcode(input, output);
615
616 byte[] imgData = ostream.toByteArray();
617 return Toolkit.getDefaultToolkit().createImage(imgData);
618 }
619
620 static public Graphics2D setupGraphics2D(Graphics graphics) {
621 Graphics2D g = (Graphics2D) graphics;

Callers 1

getLibImageMethod · 0.95

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected