/** * Read and parse an SVG from the given {@code InputStream}. * * @param is the input stream from which to read the file. * @return an SVG instance on which you can call one of the render methods. * @throws SVGParseException if there is an error parsing the document. */ getFromInputStream(InputStream) : SVG
/** * Read and parse an SVG from the given {@code String}. * * @param svg the String instance containing the SVG document. * @return an SVG instance on which you can call one of the render methods. * @throws SVGParseException if there is an error parsing the document. */ getFromString(String) : SVG
/** * Read and parse an SVG from the given resource location. * * @param context the Android context of the resource. * @param resourceId the resource identifier of the SVG document. * @return an SVG instance on which you can call one of the render methods. * @throws SVGParseException if there is an error parsing the document. */ getFromResource(Context, int) : SVG
/** * Read and parse an SVG from the given resource location. * * @param resources the set of Resources in which to locate the file. * @param resourceId the resource identifier of the SVG document. * @return an SVG instance on which you can call one of the render methods. * @throws SVGParseException if there is an error parsing the document. */ getFromResource(Resources, int) : SVG
/** * Read and parse an SVG from the assets folder. * * @param assetManager the AssetManager instance to use when reading the file. * @param filename the filename of the SVG document within assets. * @return an SVG instance on which you can call one of the render methods. * @throws SVGParseException if there is an error parsing the document. * @throws IOException if there is some IO error while reading the file. */ getFromAsset(AssetManager, String) : SVG
...... if (currentElement instanceof SVG.TextContainer) { // The SAX parser can pass us several text nodes in a row. If this happens, we // want to collapse them all into one SVG.TextSequence node SVG.SvgConditionalContainerparent= (SVG.SvgConditionalContainer) currentElement; intnumOlderSiblings= parent.children.size(); SVG.SvgObjectpreviousSibling= (numOlderSiblings == 0) ? null : parent.children.get(numOlderSiblings - 1); if (previousSibling instanceof SVG.TextSequence) { // Last sibling was a TextSequence also, so merge them. ((SVG.TextSequence) previousSibling).text += newString(ch, start, length); } else { // Add a new TextSequence to the child node list ((SVG.SvgConditionalContainer) currentElement).addChild(newSVG.TextSequence(newString(ch, start, length))); } }
/** * Renders this SVG document to a Picture object. * <p> * An attempt will be made to determine a suitable initial viewport from the contents of the SVG file. * If an appropriate viewport can't be determined, a default viewport of 512x512 will be used. * * @return a Picture object suitable for later rendering using {@code Canvas.drawPicture()} */ renderToPicture() : Picture
/** * Renders this SVG document to a Picture object. * * @param widthInPixels the width of the initial viewport * @param heightInPixels the height of the initial viewport * @return a Picture object suitable for later rendering using {@code Canvas.darwPicture()} */ renderToPicture(int, int) : Picture
/** * Renders this SVG document to a Picture object using the specified view defined in the document. * <p> * A View is an special element in a SVG document that describes a rectangular area in the document. * Calling this method with a {@code viewId} will result in the specified view being positioned and scaled * to the viewport. In other words, use {@link #renderToPicture()} to render the whole document, or use this * method instead to render just a part of it. * * @param viewId the id of a view element in the document that defines which section of the document is to be visible. * @param widthInPixels the width of the initial viewport * @param heightInPixels the height of the initial viewport * @return a Picture object suitable for later rendering using {@code Canvas.drawPicture()}, or null if the viewId was not found. */ renderViewToPicture(String, int, int) : Picture
/** * Renders this SVG document to a Canvas object. The full width and height of the canvas * will be used as the viewport into which the document will be rendered. * * @param canvas the canvas to which the document should be rendered. */ renderToCanvas(Canvas) : void
/** * Renders this SVG document to a Canvas object. * * @param canvas the canvas to which the document should be rendered. * @param viewPort the bounds of the area on the canvas you want the SVG rendered, or null for the whole canvas. */ renderToCanvas(Canvas, RectF) : void
/** * Renders this SVG document to a Canvas using the specified view defined in the document. * <p> * A View is an special element in a SVG documents that describes a rectangular area in the document. * Calling this method with a {@code viewId} will result in the specified view being positioned and scaled * to the viewport. In other words, use {@link #renderToPicture()} to render the whole document, or use this * method instead to render just a part of it. * <p> * If the {@code <view>} could not be found, nothing will be drawn. * * @param viewId the id of a view element in the document that defines which section of the document is to be visible. * @param canvas the canvas to which the document should be rendered. */ renderViewToCanvas(String, Canvas) : void
/** * Renders this SVG document to a Canvas using the specified view defined in the document. * <p> * A View is an special element in a SVG documents that describes a rectangular area in the document. * Calling this method with a {@code viewId} will result in the specified view being positioned and scaled * to the viewport. In other words, use {@link #renderToPicture()} to render the whole document, or use this * method instead to render just a part of it. * <p> * If the {@code <view>} could not be found, nothing will be drawn. * * @param viewId the id of a view element in the document that defines which section of the document is to be visible. * @param canvas the canvas to which the document should be rendered. * @param viewPort the bounds of the area on the canvas you want the SVG rendered, or null for the whole canvas. */ renderViewToCanvas(String, Canvas, RectF) : void