Repo created
This commit is contained in:
parent
f2d952b743
commit
3ecd57d1b2
475 changed files with 37130 additions and 2 deletions
32
srcs/res/SvgToVector.java
Normal file
32
srcs/res/SvgToVector.java
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
package srcs.res;
|
||||
|
||||
import com.android.ide.common.vectordrawable.Svg2Vector;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
|
||||
/** Inspired from Bernard Ladenthin's answer:
|
||||
https://stackoverflow.com/a/78898372 */
|
||||
public class SvgToVector
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
if (args.length != 2)
|
||||
{
|
||||
System.out.println("Usage: svg_to_vector <input_file> <output_file>");
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
File input_file = new File(args[0]);
|
||||
FileOutputStream output_stream = new FileOutputStream(args[1]);
|
||||
String warnings;
|
||||
warnings = Svg2Vector.parseSvgToXml(input_file, output_stream);
|
||||
System.err.println(warnings);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
System.exit(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue