2

Android likes drawables to be vector paths now like this:

<vector android:height="24dp" android:viewportHeight="140.0"
        android:viewportWidth="140.0" android:width="24dp" 
        xmlns:android="http://schemas.android.com/apk/res/android">

    <path android:fillAlpha="0.15" android:fillColor="#00000000"
          android:pathData="M45.58,145L45.58,-3"
          android:strokeAlpha="0.15" 
          android:strokeColor="#333333" 
          android:strokeWidth="24"/>

</vector>

However, making paths by hand becomes very overwhelming very quickly!

What tools are there to 1) take an image and export it as a path, and 2) take a path like above, render it as an image, and allow the image to be manipulated so the new path can be exported via 1?

I've been looking and looking and I can't figure out how to get these vectors. Thanks for your help!

Elliptica
  • 3,928
  • 3
  • 37
  • 68

2 Answers2

3

First, you need an image (.png preferred) what you want.

Then convert it to SVG. You can use an online converter for it

After that, u need to convert that SVG to vector drawable. u can use this link http://a-student.github.io/SvgToVectorDrawableConverter.Web/ for it.

Make sure that u need to provide e compatible image for it. otherwise your vector drawable may not be same as u expected

This easiest way to use svg in android? contains other alternative solutions that you can use.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
PushpikaWan
  • 2,437
  • 3
  • 14
  • 23
  • Thank you, that works perfectly for converting SVG to Vector path!! Do you know how to take a given path and turn it into an image so the image can be modified? – Elliptica Oct 24 '18 at 03:12
  • This https://stackoverflow.com/questions/44948396/convert-vectordrawable-to-svg will help for u. you need to convert it to SVG first. Then png. Please mark the answer as accepted. if it is help for u. Thanks – PushpikaWan Oct 24 '18 at 03:16
1

Android Studio allows for creating your own vector drawables from svg files. For converting path to image, I guess you can show drawable on Imageiew and capture it - you can do it pragmatically. Refer here.

  • Yes, the pragmatic way is possible, I was hoping there might be a program, since it's a path, that if you load it in, it would give you the nodes so the image can be manipulated and a new path exported cleanly. Are you aware of any? – Elliptica Oct 24 '18 at 03:14