开发者

how to read svg file

开发者 https://www.devze.com 2023-01-25 17:52 出处:网络
can any开发者_StackOverflow中文版 one tell me which classes supports to read & display svg files in android.Try this

can any开发者_StackOverflow中文版 one tell me which classes supports to read & display svg files in android.


Try this

https://launchpad.net/libsvg-android

as found in this other question SVG to Android Shape


AndroidSVG is a third party library and provides classes to render SVG files.

You may also set the width and height of the SVG file.

Following is a sample code snippet to read an SVG File :

val svg = SVG.getFromResource(resources, R.raw.ic_motorcycle_black_24px)

svg.renderToCanvas(canvas)

For full example and working Android application refer Kotlin Android Tutorial - Android Draw SVG to Canvas

0

精彩评论

暂无评论...
验证码 换一张
取 消